Some parameters like background-color
, border-color
, contain-color
, trim-color
and text-color
expect color values to work as expected.
Color values can be specified in three different notations: RGB, hexadecimal (with short hexadecimal as alternative) and named colors.
RGB color values are specified using integer values in the range 0
to 255
for each component:
-
R,G,B
: to specify three color components. i.e. 255,0,0
for yellow color.
-
R,G,B,A
: to specify three color components and alpha transparency. i.e. 255,255,0,128
for half-transparent yellow.
Hexadecimal color values are specified using 6 or 8 hexadecimal characters:
-
RRGGBB
: to specify three color components. i.e. FFFF00
for yellow color.
-
RRGGBBAA
: to specify three color components and alpha transparency. i.e. FFFF0080
for half-transparent yellow.
Hexadecimal color values are case-insensitive so you can use FFFF00
or ffff00
to specify the same color.
If both digits for every color component are the same you can use short hexadecimal values, using 3 or 4 hexadecimal characters:
-
RGB
: to specify three color components. i.e. FF0
for yellow color, equivalent to FFFF00
.
-
RGBA
: to specify three color components and alpha transparency. i.e. FF08
for almost half-transparent yellow, equivalent to FFFF0088
.
Short hexadecimal color values are case-insensitive so you can use FF0
or ff0
to specify the same color.
You can choose one of the following named colors to be used as color values. i.e background-color=black
.