Content Methodology
Every color value published on COOLOUR is computed by a documented formula. This page shows exactly which formula, so you can verify our output independently.
HEX ⇄ RGB
HEX is a six-digit hexadecimal representation of three 8-bit channels. #RRGGBB → three decimal values 0–255 by parsing each two-character pair as a hex byte. The #RGB shorthand is expanded by duplicating each character.
Source: W3C CSS Color Module Level 3, §4.2.1.
RGB ⇄ HSL
RGB (0–255 per channel) is first normalized to 0–1. HSL is then computed as follows:
max = max(r, g, b); min = min(r, g, b); delta = max − min
L = (max + min) / 2
if delta = 0: H = 0, S = 0
else:
S = delta / (1 − |2L − 1|)
H depends on which channel is the max (standard piecewise formula)
H = 60 × (appropriate expression, mod 6)
The reverse (HSL → RGB) uses the standard hueToRgb helper formula from CSS Color Module Level 3, §4.2.4.
RGB ⇄ CMYK
COOLOUR uses the standard subtractive conversion without color profiles:
K = 1 − max(R/255, G/255, B/255)
C = (1 − R/255 − K) / (1 − K)
M = (1 − G/255 − K) / (1 − K)
Y = (1 − B/255 − K) / (1 − K)
CMYK → RGB: R = 255 × (1 − C/100) × (1 − K/100) (and likewise for G, B).
Important: this is a screen-oriented approximation. Real print color accuracy requires an ICC profile for the specific press, paper and ink. We do not claim to provide accurate print color matching.
Contrast Ratio (WCAG)
Contrast ratio uses the WCAG 2.x relative luminance formula:
For each channel c (normalized 0–1):
c_lin = c ≤ 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ^ 2.4
Relative luminance L = 0.2126 × R_lin + 0.7152 × G_lin + 0.0722 × B_lin
Contrast ratio = (lighter_L + 0.05) / (darker_L + 0.05)
Source: W3C WCAG 2.2, §1.4.3 and its "relative luminance" definition.
Shades, Tints, Tones
Shades mix the color with black: result = base × (1 − amount). Tints mix with white: result = base + (255 − base) × amount. Tones mix with 50% gray (128): result = base + (128 − base) × amount.
These are the same operations used by every design tool and are mathematically equivalent to the standard definitions of shade, tint and tone.
Delta-E (color name matching)
The Color Name Finder uses the CIE76 delta-E formula in the CIE Lab color space:
ΔE = √((L1 − L2)² + (a1 − a2)² + (b1 − b2)²)
CIE Lab is computed from sRGB via the standard sRGB → XYZ (D65 white point) → Lab transform.
Source: CIE 1976 (L*a*b*) color space definition; sRGB transform per IEC 61966-2-1.
Color Blindness Simulation
Our simulator applies the linear transform matrices from Brettel, Viénot & Mollon (1997) for the three dichromatic vision types (protanopia, deuteranopia, tritanopia), and a luminance-preserving matrix for achromatopsia.
These matrices are a widely used educational approximation. They do not perfectly match individual experiences of color vision deficiency, which vary even within the same deficiency type.
Encyclopedia color values
For colors that exist in the CSS Color Module Level 4 named colors list, we use the CSS-defined value exactly. For colors that come from other well-known sources (like the traditional "teal" duck or the X11 color set), we cite the source in the color's entry.
For colors that are our own entries (like charcoal as #202A27), the specific HEX value is a design decision, not a claim of a universally-recognized standard. We document this in the entry itself.
What we don't calculate
- We do not perform ICC-profile color management. Any CMYK output is an approximation.
- We do not perform spectral color matching. Our perceptual color metrics use the CIE76 formula, which is well-established but not the most current (CIE2000 is more accurate but still not universally supported).
- We do not perform display calibration. Screen-observed color depends on the display; we cannot correct for that.
Verifying our work
Every formula above is documented to a public standard. You can verify any value COOLOUR produces by:
- Reading the relevant section of the W3C CSS Color Module Level 3 or WCAG 2.2
- Applying the formula manually to a known color
- Comparing against our tool's output
If you find a discrepancy, please report it via the Correction Policy.
Contact
Questions about our methodology: hello@coolour.pages.dev. See also: Sources & References · Editorial Policy.