Overview
Sources
Libraries
Images API

Color Values

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

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

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.

Short hexadecimal

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.

Named colors

You can choose one of the following named colors to be used as color values. i.e background-color=black.

aliceblue
antiquewhite
aqua
aquamarine
azure
beige
bisque
black
blanchedalmond
blue
blueviolet
brown
burlywood
cadetblue
chartreuse
chocolate
coral
cornflowerblue
cornsilk
crimson
cyan
darkblue
darkcyan
darkgoldenrod
darkgray
darkgreen
darkgrey
darkkhaki
darkmagenta
darkolivegreen
darkorange
darkorchid
darkred
darksalmon
darkseagreen
darkslateblue
darkslategray
darkslategrey
darkturquoise
darkviolet
deeppink
deepskyblue
dimgray
dimgrey
dodgerblue
firebrick
floralwhite
forestgreen
fuchsia
gainsboro
ghostwhite
gold
goldenrod
gray
green
greenyellow
grey
honeydew
hotpink
indianred
indigo
ivory
khaki
lavender
lavenderblush
lawngreen
lemonchiffon
lightblue
lightcoral
lightcyan
lightgoldenrodyellow
lightgray
lightgreen
lightgrey
lightpink
lightsalmon
lightseagreen
lightskyblue
lightslategray
lightslategrey
lightsteelblue
lightyellow
lime
limegreen
linen
magenta
maroon
mediumaquamarine
mediumblue
mediumorchid
mediumpurple
mediumseagreen
mediumslateblue
mediumspringgreen
mediumturquoise
mediumvioletred
midnightblue
mintcream
mistyrose
moccasin
navajowhite
navy
oldlace
olive
olivedrab
orange
orangered
orchid
palegoldenrod
palegreen
paleturquoise
palevioletred
papayawhip
peachpuff
peru
pink
plum
powderblue
purple
rebeccapurple
red
rosybrown
royalblue
saddlebrown
salmon
sandybrown
seagreen
seashell
sienna
silver
skyblue
slateblue
slategray
slategrey
snow
springgreen
steelblue
tan
teal
thistle
tomato
turquoise
violet
wheat
white
whitesmoke
yellow
yellowgreen