Colors are RGBA (red, green and blue components plus an 'alpha' or opacity level), and can be specified in these ways:

  • Hexadecimal 24-bit RGB, in the form #RRGGBB, where each group of two hex digits is an 8-bit intensity value. An opacity value of 255 (fully opaque) is used.
  • Hexadecial 24-bit RGB using three digits only: #RGB; the digits are treated as #RRGGBB
  • Hexadecimal 32-bit RGBA, in the form #RRGGBBAA, where the first three groups of two hex digits are the red, green and blue intensity levels and the last (AA) is the alpha or opacity value, where 0 = transparent and 255 = opaque.
  • Hexadecimal 32-bit RGBA using four digits only: #RGBA; the digits are treated as #RRGGBBAA
  • As an SVG color keyword. SVG (the W3 Scalable Vector Graphics standard) defines over a hundred keywords for colors, including all the common names and many unusual ones like 'khaki' and 'teal'.

You can mix colors like by appending an expression of the form +<proportion><color>, like this:

limegreen+0.2red: a color made from four-fifths (0.8) lime green and one-fifth (0.2) red

lightgreen+white: half light green, half white: if the proportion is omitted, 0.5 (50%) is assumed

#324+0.7white: the color #332244, blended with white in the proportion 0.3:0.7

Apart from colors there are patterns, which need not be plain colors. Anywhere a color is used you can also use a pattern. Patterns are referenced by name using the form 'url(#name)'. The pattern must be defined and named before it is used. The <defs> section is the best place for this.

Style Sheets Directory