Digital interfaces and physical print media rely on fundamentally different color reproduction models. Web developers frequently move between hardware sRGB coordinates, cylindrical human-intuitive HSL values, subtractive CMYK ink percentages, and modern CSS Color Level 4 OKLCH spaces.
The Color Converter computes instantaneous, bidirectional conversions across all 6 core color models with mathematical precision in volatile browser memory.
1. Supported Color Spaces & Mathematics
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ sRGB / HEX │ ──▶ │ HSL / HSV │ ──▶ │ CSS OKLCH │
│ 0 to 255 │ │ 0° to 360° │ │ Perceptual │
└──────────────┘ └──────────────┘ └──────────────┘
│ ▲
▼ │
┌──────────────┐ │
│ Print CMYK │ ─────────────────────────────────┘
│ 0% to 100% │
└──────────────┘
A. Hexadecimal & sRGB
Standard 24-bit additive RGB channels where Red, Green, and Blue range from 0 to 255. The hexadecimal representation maps byte values directly to 2-digit hex pairs (#RRGGBB):
color: #2563eb;
color: rgb(37, 99, 235);
B. HSL (Hue, Saturation, Lightness)
Cylindrical coordinate representation where:
- Hue (H): Angle on color wheel (0 deg to 360 deg).
- Saturation (S): Vibrancy intensity (0% to 100%).
- Lightness (L): Luminance factor (0% = black, 100% = white, 50% = pure color).
Lightness = (max(R, G, B) + min(R, G, B)) / 2
C. HSV (Hue, Saturation, Value / Brightness)
Favored by graphic artists and color pickers. Unlike HSL, maximum Value (100%) corresponds to pure color brightness rather than washing out to pure white.
D. Subtractive CMYK (Cyan, Magenta, Yellow, Key Black)
Subtractive color model used in four-color process lithographic printing:
K = 1 - max(R', G', B')
C = (1 - R' - K) / (1 - K)
M = (1 - G' - K) / (1 - K)
Y = (1 - B' - K) / (1 - K)
E. Modern CSS OKLCH (Oklab Lightness, Chroma, Hue)
Standardized in CSS Color Module Level 4. Unlike sRGB and HSL, OKLCH is perceptually uniform: two colors with the same Lightness value appear equally bright to the human visual cortex regardless of hue angle.
color: oklch(0.55 0.22 260);
2. Step-by-Step Conversion Workflow
[ Step 1: Input Color in Any Format ] ──▶ [ Step 2: Live Math Matrix ] ──▶ [ Step 3: Copy CSS String ]
- Enter your color in the active input field using HEX (
#3B82F6), RGB (rgb(59, 130, 246)), HSL (hsl(217, 91%, 60%)), or OKLCH syntax. - The interactive color picker and slider controls sync immediately.
- Inspect generated color chips including 10-step monochromatic shades and tints.
- Click the copy icon adjacent to any color format string for direct pasting into CSS or Tailwind stylesheets.