How We Calculate
Every number on CoolColor Space comes from a published formula or an open dataset. Tool results are calculated in your browser; the reference numbers on chart and guide pages are calculated when the site is built. This page lists what each tool uses, which results are approximate and why, and how the data is checked.
Color conversions
HEX, RGB, HSL, HSV, HWB, LAB, LCH, OKLCH and the other formats are converted with culori, an open-source color library. A LAB, LCH or OKLCH color outside the sRGB range a screen can show has each red, green and blue value cut to 0–255 separately (culori's formatHex clips channels; it does not search for the perceptually nearest color), so its hue and lightness can shift.
CMYK uses the simple formula from RGB, without a print profile. Real print values depend on the press, the inks and the paper, so for print use the CMYK values from your printer's profile.
Contrast
The contrast checker uses the WCAG 2 formula: the relative luminance of both colors and the ratio between them, from 1:1 to 21:1. The thresholds are 4.5:1 for normal text and 3:1 for large text at level AA, and 7:1 and 4.5:1 at level AAA. APCA, a separate contrast method in public beta, is not part of WCAG 2 or of the current WCAG 3 draft. The checker shows its Lc value next to the WCAG ratio as extra guidance, computed with the apca-w3 package, unmodified.
Ratios close to a threshold matter: on white, #767676 reaches 4.54:1 and passes AA, while #777777 is 4.478:1 and fails, even though it would round to 4.5. The checker therefore cuts ratios to two decimals instead of rounding them (#777777 shows 4.47:1), so a pair that fails never shows the threshold number.
The image contrast checker applies the same formula to text over a photo. The pixels in the selected box are split by luminance with Otsu’s method; the group made of thinner shapes is the text, parts of it more than 2.5 times thicker than a stroke (a bright sun behind light letters) go back to the background, and background pixels touching the letters are dropped as anti-aliased edges. The text color is taken from the far end of the text pixels (the 2% farthest from the background are skipped as compression artifacts, the next 6% averaged), because anti-aliasing and JPEG compression blend most pixels of a thin letter with the background. Semi-transparent text typed as rgba() is blended over each background pixel first, as a browser does. Only background within about three stroke widths of the letters is measured: W3C failure F83 checks the background behind each letter, and technique G18 measures the background pixels next to it. The text color is compared with each of those pixels, and the result is given for the median, the 10th percentile and the worst spot: the lowest ratio after each background pixel is replaced by the median of its 3×3 block, so a single noisy pixel cannot be the worst. WCAG sets no statistic for a photo. The 10th percentile is looser than the per-letter check in F83 and the worst spot is the closer match, so pass or fail uses whichever of the two is lower. The suggested overlay is the lower opacity of a black or a white layer, blended the way browsers blend rgba() layers, that brings that weakest pixel up to the target ratio; the background is then measured again with the layer. APCA Lc is computed for the same pixels with the apca-w3 package and summarised as the weakest 10% and the median, with the sign; that summary is also our method, not part of APCA.
Color difference (ΔE)
Wherever the site finds the closest match — Pantone, DMC, Anchor, RAL or Tailwind — it ranks candidates by CIEDE2000 (ΔE 2000), a standard color difference formula designed to follow how people perceive differences. As a guide: below 1 the difference is not visible, 1 to 3 is a close match, 3 to 6 is noticeable, and from 6 up the colors are visibly different.
Pantone® approximations
Pantone colors are physical inks, and their official digital values are licensed. The 1,342 Pantone code values on this site come from open, MIT-licensed community packages. A code is included only if it exists in an X-Rite color book and its value agrees with at least one independent conversion within ΔE 3. The Color of the Year pages are separate: their screen values come from the Wikipedia article on Pantone, and the year, name and TCX code of each color are confirmed by a second published source.
These are approximations of ink on screen, not official Pantone values. Before printing, check the color in a physical Pantone guide. Pantone® is a trademark of Pantone LLC; this site is not affiliated with Pantone.
DMC threads
The thread colors come from the open craft-color-codes list (CC BY 4.0). Open DMC lists disagree with each other: between the two independent lists we compared, the median difference is ΔE 6.9. Codes where both lists agree within ΔE 3 are marked as stable — 64 of 489. Many diamond painting kits number their drills with the same DMC codes, so the diamond painting chart shows these floss colors for the starter set of 154 DMC codes in craft-color-codes.
Thread has sheen and dye lots vary, so check a real skein or a color card before buying. DMC is a trademark of DMC; this site is not affiliated with DMC.
Miyuki Delica beads
The HEX to Delica bead colors come from the open craft-color-codes list (CC BY 4.0): 1288 Delica 11/0 codes, 76 of them discontinued. Each color is the average of every pixel of Miyuki's product photo of that code. The list's makers compared it with two independent bead datasets: the color family agreed on every code, and the shade differed by a median ΔE of 6–12. We found no second licensed list, so no bead is marked stable. Matches use CIEDE2000, as everywhere else.
Metallic, galvanized, AB and silver-lined beads cannot be one flat color (the source says so), and the finder marks them, together with metal-plated and gold- or copper-lined beads. Miyuki and Delica are trademarks of their owner; this site is not affiliated with Miyuki.
RAL colors
RAL Classic colors are defined by physical samples, and RAL gGmbH publishes no screen values we can use. The values shown come from three open lists, ral-colors, ralative and Bit&Black colorpalette (all MIT); ral-colors and ralative differ by a median ΔE of 4.6. Codes whose open values we could not confirm are left out, so the chart has 127 codes, not the whole range. Codes where another list agrees within ΔE 3 are marked «Open lists agree» — 102 of 127. Each code page shows the values side by side.
Paint and powder coatings change with gloss, texture and light, so check an original RAL color fan before ordering. RAL is a trademark of RAL gGmbH; this site is not affiliated with RAL.
Anchor threads and DMC ↔ Anchor
Anchor colors come from the open go-cross-stitch list (MIT). Open Anchor lists disagree too: between the two independent lists we compared, the median difference is ΔE 6.5, and 54 of 442 codes agree within ΔE 3. DMC to Anchor and Anchor to DMC do not copy a conversion chart — we found none with a clean licence — but rank the other brand's threads by CIEDE2000 from the entered thread's color.
The result is the nearest thread by on-screen color, not an official equivalence. Anchor is a trademark of its owner; this site is not affiliated with that owner.
Tailwind CSS colors
HEX to Tailwind uses the default palettes of Tailwind CSS 4.3.3 and 3.4. Tailwind v4 defines its colors in OKLCH; we compare against the sRGB color a screen actually shows for each one, so a color picked from a v4 site finds its own class.
matplotlib and R color names
Matplotlib Colors reads the names and HEX values from _color_data.py of matplotlib 3.11.2: the base letters, the Tableau tab: colors, CSS4 and the XKCD survey colors. R's names come from R 4.6.2 and their values from the X11 color database; the import stops if any R value differs from X11. The closest name is ranked by CIEDE2000, like every other match on the site.
Color blindness simulation
The simulator follows published models, as reviewed by DaltonLens:
- protanopia and deuteranopia — Viénot, Brettel and Mollon (1999);
- tritanopia — Brettel, Viénot and Mollon (1997);
- protanomaly and deuteranomaly — Machado, Oliveira and Fernandes (2009), with a severity slider;
- tritanomaly — the Brettel 1997 model blended with the original color by severity;
- achromatopsia — luminance only.
The calculation runs in linear RGB, not on gamma-encoded values, which would make reds and purples look far too dark. Photos, videos and the camera are processed on your device and never uploaded.
The simulation shows roughly how colors may look. It is a design aid, not a medical test.
Palettes
The palette generator builds harmonies — complementary, analogous, triadic and others — by rotating the hue in HSL, and tints and shades by changing HSL lightness. HSL steps are simple but not perceptually even, so two tints can look further apart than their numbers suggest.
Palettes from an image or a video split the picture's colors into groups where they differ most, refine the groups with k-means and take the average of each. Groups that look the same are merged, so slight noise in a flat area does not add a color. The file is read in your browser and is not sent to a server.
Paint mixing
The color mixer uses the open-source spectral.js library (MIT). Each color is turned into a reflectance curve built from seven basic curves, the curves are mixed by single-constant Kubelka-Munk theory, weighted by each color's share, luminance and tinting strength, and the result is converted back to sRGB under D65. This is a model of pigments in general: a real paint with the same screen color can mix differently.
Next to it the mixer shows the share-weighted average of the gamma-encoded RGB values, the way a semi-transparent layer blends. The color names beside the results are rough labels from OKLCH hue and lightness.
How the data is checked
Before changes are published, an automated check compares the color data with reference values, for example:
- every converter converts its own examples correctly;
- every Pantone code and page address reads back to the same color;
- Tailwind values match reference colors from the Tailwind documentation, and every Tailwind and DMC color finds itself as its own closest match;
- the simulator's output matches the DaltonLens reference values within ΔE 2, type by type.
Found a wrong number?
If a value looks wrong, tell us which page and which color. We recalculate it and fix the data or the explanation.
Sources
- W3C (2018, current edition 6 May 2025). Web Content Accessibility Guidelines (WCAG) 2.1: definitions of relative luminance and contrast ratio, success criteria 1.4.3 and 1.4.6. Link
- W3C. Technique F83: Failure of Success Criterion 1.4.3 and 1.4.6 due to using background images that do not provide sufficient contrast (test procedure: the background behind each letter). Link
- W3C. Technique G18: Ensuring that a contrast ratio of at least 4.5:1 exists between text (and images of text) and background behind the text (test procedure: background pixels immediately next to the letter). Link
- Luo M. R., Cui G., Rigg B. (2001). The development of the CIE 2000 colour-difference formula: CIEDE2000. Color Research & Application 26(5), 340–350. DOI
- Sharma G., Wu W., Dalal E. N. (2005). The CIEDE2000 color-difference formula: implementation notes, supplementary test data, and mathematical observations. Color Research & Application 30(1), 21–30. DOI
- Viénot F., Brettel H., Mollon J. D. (1999). Digital video colourmaps for checking the legibility of displays by dichromats. Color Research & Application 24(4), 243–252. DOI
- Brettel H., Viénot F., Mollon J. D. (1997). Computerized simulation of color appearance for dichromats. Journal of the Optical Society of America A 14(10), 2647–2655. DOI
- Machado G. M., Oliveira M. M., Fernandes L. A. F. (2009). A physiologically-based model for simulation of color vision deficiency. IEEE Transactions on Visualization and Computer Graphics 15(6), 1291–1298. DOI
- libDaltonLens: public-domain implementation of the Viénot and Brettel models (DaltonLens). Link
- Kubelka P., Munk F. (1931). Ein Beitrag zur Optik der Farbanstriche. Zeitschrift für technische Physik 12, 593–601. English translation by S. Westin. Link
- spectral.js: Kubelka-Munk paint mixing in JavaScript (MIT licence). Link
- Newhall S. M., Nickerson D., Judd D. B. (1943). Final report of the O.S.A. subcommittee on the spacing of the Munsell colors. Journal of the Optical Society of America 33(7), 385–418. DOI
- Munsell Color Science Laboratory, Rochester Institute of Technology: Munsell renotation data. Link