什么是颜色转换?
颜色可以使用多种格式表示,其中最常见的包括 HEX(十六进制)、RGB(红绿蓝)和 HSL(色相、饱和度、亮度)。每种格式适用于不同场景:HEX 常用于 CSS 样式表,RGB 用于程序化颜色操作,HSL 更符合人类对颜色的直观理解。
- HEX:以 # 开头的 6 位十六进制数,如 #ff0000 表示红色
- RGB:红绿蓝三个通道的值范围 0-255,如 rgb(255, 0, 0)
- HSL:色相 0-360°、饱和度 0-100%、亮度 0-100%,更直观
What is Color Conversion?
Colors can be represented in several formats, the most common being HEX (hexadecimal), RGB (Red Green Blue), and HSL (Hue, Saturation, Lightness). Each format suits different scenarios: HEX is commonly used in CSS stylesheets, RGB for programmatic color manipulation, and HSL for human-intuitive color understanding.
- HEX — A 6-digit hexadecimal number prefixed with #, e.g., #ff0000 for red
- RGB — Three channel values ranging 0-255, e.g., rgb(255, 0, 0)
- HSL — Hue 0-360°, Saturation 0-100%, Lightness 0-100%, more intuitive to work with