Color Converter
Auto-detect HEX/RGB/HSL input and convert instantly. Copy-ready outputs for CSS.
Input
Any Format
HEX
RGB
HSL
CMYK
HSV
HWB
Preview
Color Code Table
纯红 Red
纯绿 Green
纯蓝 Blue
纯黄 Yellow
青色 Cyan
洋红 Magenta
纯黑 Black
纯白 White
猩红 Crimson
棕色 Brown
橙色 Orange
适中的蓝色 MediumBlue
午夜的蓝色 MidnightBlue
深蓝色 DarkBlue
海军蓝 Navy
皇家蓝 RoyalBlue
矢车菊的蓝色 CornflowerBlue
适中的板岩暗蓝灰 MediumSlateBlue
板岩暗蓝灰 SlateBlue
深岩暗蓝灰 DarkSlateBlue
淡钢蓝 LightSteelBlue
浅石板灰 LightSlateGray
石板灰 SlateGray
紫色 Purple
深洋红 DarkMagenta
深紫罗兰 DarkViolet
深兰花紫 DarkOrchid
靛青 Indigo
深紫罗兰的蓝 BlueViolet
适中的紫色 MediumPurple
适中的兰花紫 MediumOrchid
兰花的紫色 Orchid
紫罗兰 Violet
李子 plum
蓟 Thistle
熏衣草 Lavender
浅粉红 LightPink
粉红 Pink
薰衣草腮红 LavenderBlush
苍白的紫罗兰红 PaleVioletRed
热情的粉红 HotPink
深粉 DeepPink
适中的紫罗兰红 MediumVioletRed
灰色 Gray
幽灵的白 GhostWhite

About Color Conversion: Essential Concepts You Need to Know

HEX works well for design tokens and code constants, RGB intuitively expresses primary channels, and HSL excels at palette generation and color adjustment. Below is a brief introduction to color space fundamentals, practical use cases for each format, and local-browser processing principles — to help you use this tool more efficiently.

#01

Color Space Basics: HEX/RGB/HSL

RGB (Red Green Blue) is an additive color model that produces colors by superimposing red, green, and blue light at different intensities. Each channel is represented as an integer from 0 to 255. In Canvas, WebGL, and other graphics programming, RGB is also the most natural data type — pixel values are typically stored in R-G-B-A order.

HEX (hexadecimal) is essentially another way to write RGB — each 0-255 channel is written as two hexadecimal digits, prefixed with #. The standard form is #RRGGBB, with a 3-digit shorthand #RGB available when each channel has identical digits. Since CSS Color Module Level 4, #RRGGBBAA (8-digit HEX) and #RGBA are also supported, adding an alpha channel.

HSL (Hue Saturation Lightness) is closer to human perception. Its three dimensions are: hue (0°~360°), saturation (0%~100%), and lightness (0%~100%). HSL's greatest value is "adjusting saturation and lightness while keeping the hue unchanged" — this is critical for generating harmonious color schemes. For example: brand color + lighter hover state + darker active state.

#02

Advantages and Use Cases of Each Format

Different color representations are not simply "equivalent alternatives" — they are optimized for different contexts. Understanding their advantages helps you make the right choice:

  • HEX (hexadecimal) is best used as "design-picked raw values" or "color constants in code". It is short to write, easy to search in code, commonly used in JSON/config files, and has excellent compatibility with design software (Figma/Sketch/Photoshop). Common uses: color values in Tailwind themes, theme tokens in component libraries.
  • RGB / RGBA is best used in scenarios requiring precise transparency control — overlay effects, translucent masks, blurred backgrounds. Because the alpha channel (0~1) is very intuitive, and CSS supports rgba() syntax directly. Note: alpha is NOT "brightness" or "saturation" — if you want to darken a color, use HSL's L channel.
  • HSL / HSLA is best for "color palette" scenarios — when you want to generate a set of color schemes based on a primary color. A practical workflow: determine the brand primary color → use HSL adjustments to generate hover/active/disabled states → use analogous colors (H ± 30°) or complementary colors (H + 180°) for accents → use low saturation + high L for neutral background colors.

On the question of "whether to unify to a single format across projects": it is beneficial for a team to agree on a "primary format" (e.g., store everything as HEX, then convert to RGBA where transparency is needed), but you should not sacrifice readability for the sake of "absolute uniformity". The key is consistency within the same file/module.

#03

Alpha Transparency and Data Security

Alpha (transparency) is one of the most commonly misunderstood concepts in color representation. Alpha ranges from 0 to 1 (or 0% to 100%): alpha = 1 means fully opaque, alpha = 0 means fully transparent, and values in between represent partial transparency. An intuitive way to think about it: a black color set to rgba(0, 0, 0, 0.5) on a white background looks like "50% gray" — because the 0.5 opacity makes it appear as a mix of the background white and foreground black.

Three alpha-supporting syntaxes: rgba(r, g, b, a) (the most commonly used); hsla(h, s%, l%, a) (good for preserving transparency during palette adjustments); and #RRGGBBAA (8-digit hexadecimal, introduced in CSS Color Module Level 4, e.g. #00000080 for 50% opaque black). The advantage of 8-digit HEX is compact writing; the disadvantages are poorer readability and the possibility that older browsers (IE, older Safari) may not support it. Modern browsers (Chrome, Firefox, Safari 10+, Edge) all support it.

Data Security: Color processing is one of those daily development tasks that "seems insignificant but often involves sensitive information". The color values you enter in tools may come directly from design mockups (including unpublished brand visual guidelines), from client-provided product design screenshots, or from color schemes you are developing for your own new product — all of which have commercial value. This tool's core design principle is "100% browser-local execution". All color recognition, format conversion, CMYK/HSV/HWB calculations, and preview rendering — everything completes in your own browser. The tool page itself sends no backend requests related to input content; even if you disconnect from the internet and open this tool offline, it works normally.

Even so, for color processing scenarios involving highly sensitive information (e.g., unreleased brand colors, product theme colors, confidential project color schemes), we still recommend you operate in a network-disconnected, controlled environment, or close the browser tab after tool use. Safety is no trivial matter — caution is always the right choice.

📖 Want to Learn More?
Check out the full color conversion guide: color space concepts, format comparison, extended format introduction, transparency handling, HSL palette techniques, CSS color features, and data security notes (~10 minutes to read)
Read the Full Guide →