The
Cascading Style Sheets specification defines the same number of named colors as the HTML 4 spec, namely the 16
HTML colors, and 124 colors from the Netscape
X11 color list for a total of 140 names that were recognized by Internet Explorer (IE) 3.0 and Netscape Navigator 3.0. Blooberry.com notes that Opera 2.1 and Safari 1 also included Netscape's expanded list of 140 color names, but later discovered 14 names not included with Opera 3.5 on Windows 98. In CSS 2.1, the color 'orange' (one of the 140) was added to the section with the 16 HTML4 colors as a 17th color. The CSS3.0 specification did not include
orange in the "HTML4 color keywords" section, which was renamed as "Basic color keywords". In the same reference, the "SVG color keywords" section, was renamed "Extended color keywords", after starting out as "X11 color keywords" in an earlier working draft. The working draft for the level 4 color module combines the Basic and Extended sections together in a simple "Named Colors" section. CSS 2,
SVG and CSS 2.1 allow web authors to use
system colors, which are color names whose values are taken from the
operating system, picking the operating system's highlighted text color, or the background color for tooltip controls. This enables web authors to style their content in line with the operating system of the user agent. The
CSS3 color module has
deprecated the use of system colors in favor of CSS3 UI System Appearance property, which itself was subsequently dropped from CSS3. The CSS3 specification also introduces
HSL color space values to style sheets: /* RGB model */ p { color: #F00 } /* #rgb */ p { color: #FF0000 } /* #rrggbb */ p { color: rgb(255, 0, 0) } /* integer range 0 - 255 */ p { color: rgb(100%, 0%, 0%) } /* float range 0.0% - 100.0% */ /* RGB with alpha channel, added to CSS3 */ p { color: rgba(255, 0, 0, 0.5) } /* 50% opacity, semi-transparent */ /* HSL model, added to CSS3 */ p { color: hsl(0, 100%, 50%) } /* red */ p { color: hsl(120, 100%, 50%) } /* green */ p { color: hsl(120, 100%, 25%) } /* dark green */ p { color: hsl(120, 100%, 75%) } /* light green */ p { color: hsl(120, 50%, 50%) } /* pastel green */ /* HSL model with alpha channel */ p { color: hsla(120, 100%, 50%, 1) } /* green */ p { color: hsla(120, 100%, 50%, 0.5) } /* semi-transparent green */ p { color: hsla(120, 100%, 50%, 0.1) } /* very transparent green */ CSS also supports the special color transparent, which represents an alpha value of zero; by default, transparent is rendered as an invisible nominal black: rgba(0, 0, 0, 0). It was introduced in CSS1 but its scope of use has expanded over the versions. Besides new ways to write colors, it also introduces the concept of mixing colors in a non-
sRGB color space, a first step towards fixing
a well-known issue in color gradients. Some sections explaining color theory and common operations like
gamut mapping are also added to aid implementation. •
CIE Lab and LCH •
OKLab and OKLCH (preferred over Lab/LCH) CSS4 also introduces the
HWB color model as an alternative to HSL/HSV. specification introduces syntax for mixing and manipulating existing colors, including: • A color-mix() function for mixing colors • Relative color syntax for manipulating components of an existing color Custom color spaces are also supported via
ICC profiles. This allows the use of
CMYK on web pages. ==Web-safe colors==