Hex triplet
A hex triplet is a 3 byte number used in html and css to represent colors, represented in hexadecimal (hex for short). Since a byte is 8 bits, values of each element can go from 00 to FF (which is 0 to 255 in decimal), and you can create 1 number by just running the bits together, to form 000000 (black) till FFFFFF (white)- byte: red value
- byte: green value
- byte : blue value
| Table of contents |
|
2 examples 3 See also |
Construction
If you want to construct a hex triplet,
(255, 0, 0)
Convert the numbers to hexadecimal values:
(FF, 00, 00)
then just run them together:
#FF0000
examples
(your browser must support style sheets to be able to see this) Blue : #0000FF Red : #FF0000 Dark Red : #A00000 Grey : #A0A0A0 (note that any hex triplet whose three bytes are identical will result in a shade of grey) Dark Yellow : #A0A000See also
And for further examples:
Hex triplets for each color are listed under:
| Colors
White | Gray | Black Red | Orange | Yellow | Green | Blue | Indigo | Violet Aquamarine | Brown | Gold | Coral | Crimson | Cyan | Magenta | Maroon | Ochre | Pink | Purple |