Digital Color

Fonctions de couleur CSS

Les fonctions CSS intégrées pour spécifier les couleurs, incluant rgb(), hsl(), oklch(), lab() et color(), chacune utilisant un modèle de couleur différent.

CSS has evolved from supporting only hex codes and named colors to offering a rich set of color functions. The rgb() and hsl() functions have been available since CSS3. CSS Color Level 4 introduced lab(), lch(), oklab(), oklch(), and the generic color() function for specifying colors in any predefined color space like display-p3. Modern syntax uses space-separated values with an optional slash for alpha: rgb(255 128 0 / 50%). The color-mix() function enables mixing two colors in any color space, and relative color syntax allows deriving new colors from existing ones by modifying individual channels.

Essayez

Articles associés