Red, green, and blue light sources are each represented by an RGB color value.

An RGBA color value is an RGB value with an Alpha channel added (opacity).

Color Values in RGB

The following formula can be used to specify an RGB value for a colour in

Color Values in RGB

  rgb(red, green, blue)

The red, green, and blue parameters each have a value between 0 and 255 that
describes the color’s intensity.

This indicates that there are 16777216 possible colors, or 256, 256, 256!

Because red is assigned to its greatest value (255), and the other two colors
(green and blue) are set to 0, rgb(255, 0, 0), for instance, displays as red.

Another illustration is rgb(0, 255, 0), which displays green since green is
set to its maximum value (255), while red and blue are also set to 0.

Set all color settings to 0 to display black, as shown here: rgb (0, 0, 0).

Set all color settings to 255 to display white, as shown here: rgb (255, 255,

Materials download (download)

Color Values in RGBA

RGBA colour values are extensions of RGB colour values that include the Alpha
channel, which describes the opacity of a colour.

Specifying an RGBA colour value involves:

rgba(red, green, blue, alpha)

The value of the alpha parameter ranges from 0.0 (complete transparency) to
1.0 (complete lack of transparency):

Project download (download)


Text Mark Project(download)

Photo Link(download)

HEX Colors

The hexadecimal code for a color is #RRGGBB, where RR (red), GG (green), and
BB (blue) represent the color’s individual constituents.

Color Values in Hex

To specify a color in HTML, use a hexadecimal value of the following format:


where the colors red, green, and blue are represented by hexadecimal numbers
between 00 and ff (same as decimal 0-255).

Since red is set to its greatest value (ff), #ff0000 is displayed as red while
the other two colors (green and blue) are set to 00.

Another illustration is #00ff00, which is shown as green because it has the
highest value (ff), whereas the other two (red and blue) have a value of 00.

Set all color parameters to 00, as in #000000, to display black.

Set all color settings to ff, as in #ffffff, to display white.

Rate this post

Categorized in: