RGB Color Codes


The RGB color model is an additive model in which red, green, and blue (often used in additive light models) are combined in various ways to reproduce other colors.

In HTML, RGB colors are often used, as for example in the line bellow:

                     <body style="background-color: rgb(255, 255, 255);" link="#0000FF">

In this line, RGB color are displayed in two ways:

Method 1
rgb(255, 255, 255)    - for each color, a value between o and 255 is shown
  • The first number corresponds to red color
  • The second number corresponds to green  color
  • The third number corresponds to blue color.
Method 2
#0000FF                  - is basically the same as above, but uses an hexadecimal code, from 00 to FF.
  • "#" starts the code, but means nothing (in fact, may be removed)
  • the first 2 digits correspond to the amount of red color
  • the next 2 to the amount of green, and
  • the last 2 to the amount of blue.
Only the following characters can be used to generate a color code in this second method:
        0 1 2 3 4 5 6 7 8 9 A B C D E F  (a total of 16 values)

For each digit the lowest value is 0 and the highest is F. 

Method 1 and method 2 as identical

Values used in method 1 are decimal, and values in method 2 hexadecimal.
Method 1
Method 2
0
00
1
01
15
0F
16
10
255 FF

The purpose of this page is only to let you know how colors are coded.

Bellow are shown  some colors generated by using method 2.

000000 ...........
330000 ...........
660000 ...........
990000 ...........
CC0000 ...........
FF0000 ...........
000000 ...........
003300 ...........
006600 ...........
009900 ...........
00CC00 ...........
00FF00 ...........
000000 ...........
000033 ...........
000066 ...........
000099 ...........
0000CC ...........
0000FF ...........
000000 ...........
333333 ...........
666666 ...........
999999 ...........
CCCCCC ...........
FFFFFF ...........
000000 ...........
003333 ...........
006666 ...........
009999 ...........
00CCCC ...........
00FFFF ...........
000000 ...........
333300 ...........
666600 ...........
999900 ...........
CCCC00 ...........
FFFF00 ...........
000000 ...........
330033 ...........
660066 ...........
990099 ...........
CC00CC ...........
FF00FF ...........