Digital Color

Hàm Màu CSS

Các hàm CSS tích hợp để xác định màu sắc, bao gồm rgb(), hsl(), oklch(), lab() và color(), mỗi hàm dùng một mô hình màu khác nhau.

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.

Dùng thử

Bài viết liên quan