Digital Color

Funções de Cor CSS

As funções CSS nativas para especificar cores, incluindo rgb(), hsl(), oklch(), lab() e color(), cada uma usando um modelo de cor diferente.

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.

Experimente

Artigos relacionados