Color Converter
Convert synchronously between HEX, RGB, HSL, and CMYK color spaces with live visual swatches, complementary color harmonies, and WCAG 2.1 text contrast accessibility ratios.
Synchronous Color Models
Step-by-Step RGB to HSL & CMYK Mathematical Transformation Proof
How to Convert Between HEX, RGB and HSL
To convert #3B82F6: 1. Split hex into pairs: R=3B₁₆=59, G=82₁₆=130, B=F6₁₆=246. 2. Normalize to [0, 1]: R'=0.231, G'=0.510, B'=0.965. 3. Lightness: L=(max+min)/2=59.8% (~60%). 4. Saturation: S=(max-min)/(2-max-min)=91.1% (~91%). 5. Hue: H=217°.
Digital Color Models: HEX, RGB, HSL & CMYK
Modern digital media relies on multiple complementary coordinate systems to specify and render color across electronic screens and physical print substrates:
Compact web and CSS markup
Raw monitor pixel phosphors
Intuitive for UI design systems
Physical 4-color offset printing
WCAG 2.1 Web Accessibility Contrast Criteria
| Compliance Level | Normal Text (< 18pt) | Large Text (≥ 18pt or Bold 14pt) | UI Components / Icons |
|---|---|---|---|
| WCAG Level AA | 4.5 : 1 Minimum | 3.0 : 1 Minimum | 3.0 : 1 Minimum |
| WCAG Level AAA | 7.0 : 1 Enhanced | 4.5 : 1 Enhanced | 4.5 : 1 Enhanced |
Real-World Applications of Digital Color Conversions
Tailwind & CSS Design Tokens
Modern design systems use HSL or OKLCH to generate dynamic hover states and accessible dark-mode color variants.
Brand Identity Guidelines
Corporate style guides specify exact RGB values for web properties and matching CMYK ink percentages for business cards.
Accessibility Auditing
Frontend teams compute relative luminance mathematically to ensure digital applications pass Section 508 and ADA audits.
Step-by-Step Worked Numerical Solutions
Problem: Convert #10B981 to RGB and CMYK.
Common Pitfalls & Mistakes
RGB to CMYK Gamut Clipping
Bright RGB neon greens and blues cannot be physically reproduced by standard CMYK printing inks and will print significantly darker.
Missing # Prefix in CSS HEX
In HTML and CSS, hexadecimal color strings must include the leading hash prefix (#) to parse correctly.
Ignoring Perceived Luminance
Pure blue rgb(0, 0, 255) has low perceived luminance (L=0.07), while pure green rgb(0, 255, 0) has high perceived luminance (L=0.72).
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.