Page 123 - CSS
P. 123
The total number of colors that can be represented with hex notation is 256 ^ 3 or 16,777,216.
Syntax
color: #rrggbb;
color: #rgb
Value Description
rr 00 - FF for the amount of red
gg 00 - FF for the amount of green
bb 00 - FF for the amount of blue
.some-class {
/* This is equivalent to using the color keyword 'blue' */
color: #0000FF;
}
.also-blue {
/* If you want to specify each range value with a single number, you can!
This is equivalent to '#0000FF' (and 'blue') */
color: #00F;
}
Hexadecimal notation is used to specify color values in the RGB color format, per the W3C's
'Numerical color values'.
There are a lot of tools available on the Internet for looking up hexadecimal (or simply hex) color
values.
Search for "hex color palette" or "hex color picker" with your favorite web browser to find a
bunch of options!
Hex values always start with a pound sign (#), are up to six "digits" long, and are case-insensitive:
that is, they don't care about capitalization. #FFC125 and #ffc125 are the same color.
rgb() Notation
RGB is an additive color model which represents colors as mixtures of red, green, and blue light.
In essence, the RGB representation is the decimal equivalent of the Hexadecimal Notation. In
Hexadecimal each number ranges from 00-FF which is equivalent to 0-255 in decimal and 0%-
100% in percentages.
.some-class {
/* Scalar RGB, equivalent to 'blue'*/
color: rgb(0, 0, 255);
}
https://riptutorial.com/ 101

