User Rating 0.0
Total Usage 0 times
Category CSS Tools
#RGB, #RRGGBB, or #RRGGBBAA
Is this tool helpful?

Your feedback helps us improve.

About

Color model mismatches cause silent failures across design-to-development handoffs. A designer specifies HSL for perceptual uniformity while a print vendor demands CMYK and the stylesheet requires HEX. Manual conversion invites rounding errors that compound through a palette of dozens of swatches. This tool converts between six color representations - HEX (3/4/6/8-digit), RGB, RGBA, HSL, CMYK, and the 148 CSS named colors - using a canonical RGBA intermediate to eliminate cascading precision loss. Conversions follow the sRGB color space model. Note: CMYK output is a mathematical approximation; physical print accuracy depends on ICC profiles and ink characteristics that this tool does not model.

color converter hex to rgb rgb to hsl cmyk converter css colors color picker named colors rgba converter

Formulas

All conversions route through a canonical RGBA tuple. The RGB-to-HSL decomposition proceeds as follows:

R′ = R255 , G′ = G255 , B′ = B255
Cmax = max(R′, G′, B′) , Cmin = min(R′, G′, B′) , Δ = Cmax Cmin
L = Cmax + Cmin2
S =
{
0 if Δ = 0Δ1 |2L 1| otherwise

For RGB to CMYK:

K = 1 Cmax
C = 1 R′ K1 K , M = 1 G′ K1 K , Y = 1 B′ K1 K

Where R, G, B are integer channel values in [0, 255], H is hue in degrees [0°, 360°), S and L are saturation and lightness as percentages, and C, M, Y, K are CMYK components as percentages. For pure black (K = 1), C = M = Y = 0.

Reference Data

Named ColorHEXRGBHSLCMYK
aliceblue#F0F8FFrgb(240, 248, 255)hsl(208, 100%, 97.1%)cmyk(5.9%, 2.7%, 0%, 0%)
coral#FF7F50rgb(255, 127, 80)hsl(16.1, 100%, 65.7%)cmyk(0%, 50.2%, 68.6%, 0%)
cornflowerblue#6495EDrgb(100, 149, 237)hsl(218.5, 79.2%, 66.1%)cmyk(57.8%, 37.1%, 0%, 7.1%)
crimson#DC143Crgb(220, 20, 60)hsl(348, 83.3%, 47.1%)cmyk(0%, 90.9%, 72.7%, 13.7%)
darkcyan#008B8Brgb(0, 139, 139)hsl(180, 100%, 27.3%)cmyk(100%, 0%, 0%, 45.5%)
gold#FFD700rgb(255, 215, 0)hsl(50.6, 100%, 50%)cmyk(0%, 15.7%, 100%, 0%)
forestgreen#228B22rgb(34, 139, 34)hsl(120, 60.7%, 33.9%)cmyk(75.5%, 0%, 75.5%, 45.5%)
hotpink#FF69B4rgb(255, 105, 180)hsl(330, 100%, 70.6%)cmyk(0%, 58.8%, 29.4%, 0%)
indigo#4B0082rgb(75, 0, 130)hsl(274.6, 100%, 25.5%)cmyk(42.3%, 100%, 0%, 49%)
ivory#FFFFF0rgb(255, 255, 240)hsl(60, 100%, 97.1%)cmyk(0%, 0%, 5.9%, 0%)
khaki#F0E68Crgb(240, 230, 140)hsl(54, 76.9%, 74.5%)cmyk(0%, 4.2%, 41.7%, 5.9%)
lavender#E6E6FArgb(230, 230, 250)hsl(240, 66.7%, 94.1%)cmyk(8%, 8%, 0%, 2%)
limegreen#32CD32rgb(50, 205, 50)hsl(120, 60.8%, 50%)cmyk(75.6%, 0%, 75.6%, 19.6%)
mediumaquamarine#66CDAArgb(102, 205, 170)hsl(159.6, 50.7%, 60.2%)cmyk(50.2%, 0%, 17.1%, 19.6%)
midnightblue#191970rgb(25, 25, 112)hsl(240, 63.5%, 26.9%)cmyk(77.7%, 77.7%, 0%, 56.1%)
olivedrab#6B8E23rgb(107, 142, 35)hsl(79.6, 60.5%, 34.7%)cmyk(24.6%, 0%, 75.4%, 44.3%)
orangered#FF4500rgb(255, 69, 0)hsl(16.2, 100%, 50%)cmyk(0%, 72.9%, 100%, 0%)
orchid#DA70D6rgb(218, 112, 214)hsl(302.3, 58.9%, 64.7%)cmyk(0%, 48.6%, 1.8%, 14.5%)
peru#CD853Frgb(205, 133, 63)hsl(29.6, 58.7%, 52.5%)cmyk(0%, 35.1%, 69.3%, 19.6%)
rebeccapurple#663399rgb(102, 51, 153)hsl(270, 50%, 40%)cmyk(33.3%, 66.7%, 0%, 40%)
salmon#FA8072rgb(250, 128, 114)hsl(6.2, 93.2%, 71.4%)cmyk(0%, 48.8%, 54.4%, 2%)
seagreen#2E8B57rgb(46, 139, 87)hsl(146.5, 50.3%, 36.3%)cmyk(66.9%, 0%, 37.4%, 45.5%)
slateblue#6A5ACDrgb(106, 90, 205)hsl(248.3, 53.5%, 57.8%)cmyk(48.3%, 56.1%, 0%, 19.6%)
steelblue#4682B4rgb(70, 130, 180)hsl(207.3, 44%, 49%)cmyk(61.1%, 27.8%, 0%, 29.4%)
teal#008080rgb(0, 128, 128)hsl(180, 100%, 25.1%)cmyk(100%, 0%, 0%, 49.8%)
tomato#FF6347rgb(255, 99, 71)hsl(9.1, 100%, 63.9%)cmyk(0%, 61.2%, 72.2%, 0%)
turquoise#40E0D0rgb(64, 224, 208)hsl(174, 72.1%, 56.5%)cmyk(71.4%, 0%, 7.1%, 12.2%)
violet#EE82EErgb(238, 130, 238)hsl(300, 76.1%, 72.2%)cmyk(0%, 45.4%, 0%, 6.7%)
wheat#F5DEB3rgb(245, 222, 179)hsl(39.1, 76.7%, 83.1%)cmyk(0%, 9.4%, 26.9%, 3.9%)
yellowgreen#9ACD32rgb(154, 205, 50)hsl(79.7, 60.8%, 50%)cmyk(24.9%, 0%, 75.6%, 19.6%)

Frequently Asked Questions

This converter performs a mathematical CMYK decomposition in the sRGB color space. Professional print workflows use ICC color profiles that account for ink absorption, paper type, and dot gain. The values here are device-independent approximations. For print-critical work, use the output as a starting reference and refine within a color-managed application like Adobe Illustrator.
A 3-digit HEX like #0F0 is expanded by doubling each digit: #00FF00. A 4-digit HEX like #0F0A is expanded to #00FF00AA, where the fourth pair represents the alpha channel. This follows the CSS Color Level 4 specification.
The converter supports RGBA via rgba(R,G,B,A) syntax and 8-digit HEX (e.g., #FF000080 for 50% transparent red). The alpha channel is preserved in the RGBA output and the HEX-8 output. HSL and CMYK outputs discard alpha as those models do not define transparency.
Yes. Several CSS named colors map to the same HEX value. For example, both "fuchsia" and "magenta" resolve to #FF00FF. When converting from HEX/RGB to a named color, the converter returns all matching names. If no CSS named color matches the exact value, the result shows "none".
Hue is rounded to 1 decimal place in degrees (0-360). Saturation and Lightness are rounded to 1 decimal place as percentages (0% - 100%). This provides sufficient precision for CSS usage while keeping values human-readable. The underlying conversion uses IEEE 754 double-precision arithmetic.
The tool accepts the traditional comma-separated syntax: rgb(R, G, B) and hsl(H, S%, L%). The modern space-separated syntax (rgb(R G B / A)) is not currently parsed. Use commas for reliable input.