Funções de Cor CSS
Embed This Widget
Add the script tag and a data attribute to embed this widget.
Embed via iframe for maximum compatibility.
<iframe src="https://colorfyi.com/iframe/glossary/css-color-functions/" width="420" height="400" frameborder="0" style="border:0;border-radius:10px;max-width:100%" loading="lazy"></iframe>
Paste this URL in WordPress, Medium, or any oEmbed-compatible platform.
https://colorfyi.com/glossary/css-color-functions/
Add a dynamic SVG badge to your README or docs.
[](https://colorfyi.com/glossary/css-color-functions/)
Use the native HTML custom element.
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
Sintaxe de Cor Relativa CSS: Transforme Qualquer Cor Dinamicamente
Domine a sintaxe de cor relativa CSS para transformar cores dinamicamente. Ajuste matiz, saturação, luminosidade e canais alfa diretamente nas suas folhas de estilos.
Funções de Cor CSS: rgb(), hsl(), oklch() Comparadas
Compare todas as funções de cor CSS — rgb(), rgba(), hsl(), hsla(), lab(), lch(), oklch() e color-mix(). Aprenda qual usar, quando, e como está o suporte nos navegadores.