2 HTML Color Codes
2 HTML Color Codes
1
Color Codes
• Colors are set using “RGB” color codes,
which are, represented as hexadecimal
values.
3
Main Colours
The total number of different colors that can be produced
6
RGB
• For example, rgb(255, 0, 0) is displayed as red, because
red is set to its highest value (255), and the other two
(green and blue) are set to 0.
7
RGB
8
9
HEX - hexadecimal value
• Where rr (red), gg (green) and bb (blue) are hexadecimal values
between 00 and ff (same as decimal 0-255).
• To display white, set all color parameters to ff, like this: #ffffff.
10
HEX
11
12
HSL
• hsl(hue, saturation, lightness)
14
15
16 Basic Colors
16
Color Codes
1. WHITE 1. #FFFFFF
2. BLACK 2. #000000
3. RED 3. #FF0000
4. GREEN 4. #00FF00
5. BLUE 5. #0000FF
6. MAGENTA 6. #FF00FF
7. CYAN 7. #00FFFF
8. YELLOW 8. #FFFF00
9. AQUAMARINE 9. #70DB93
10. BAKER’S CHOCOLATE 10. #5C3317
11. VIOLET 11. #9F5F9F
12. BRASS 12. #B5A642
13. COPPER 13. #B87333
14. PINK 14. #FF6EC7
15. ORANGE 15. #FF7F00 17
Color Codes
If you require more information about color
values, there is an excellent site entitled
“VGDesign’s Interactive Color Cube” that
displays the background color code when
you put your cursor over a small color
sample. The Web address is :
http://www.vgdesign.com/color.html
18
The Body Element
• The BODY element of a web page is an
important element in regards to the page’s
appearance. Here are the attributes of the
BODY tag to control all the levels:
TEXT="#RRGGBB" to change the color of all
the text on the page (full page text color.)
This element contains information about the
page’s background color, the background
image, as well as the text and link colors.
19