O guia desta página está disponível apenas em inglês no momento.
How to generate CSS color code
- 1Pick a color and set its opacity.
- 2Name your CSS variable.
- 3Copy the snippet you need.
Modern CSS color syntax
Modern CSS uses space-separated color functions with an optional slash for alpha: rgb(37 150 190 / 50%). Custom properties such as --color-brand let you define a color once and reuse it everywhere; storing RGB channels separately (--color-brand-rgb) makes it easy to create transparent variants.
color-mix(in oklab, …) blends colors directly in CSS and is supported in all current browsers — handy for hover states without hard-coding extra values.
Perguntas frequentes
Should I use HEX or rgb() in CSS?
Both are identical in the browser. HEX is compact; rgb() and hsl() are easier to read and adjust, and make transparency explicit.