How We Test Our Colour Tools

Results generated on . Tool behaviour checks run on . Computed results only, no testing with people.

The numbers on our tool pages and in the figures below come from scripts that run the tools' own code. They are arithmetic and rendering checks. Nobody looked at these colours on a calibrated screen, printed them, or asked people what they could read. This page says exactly what was run and what that leaves out.

Method

Formulas

Contrast. WCAG 2.2 defines relative luminance as L = 0.2126 R + 0.7152 G + 0.0722 B, where each channel is first divided by 255 and linearised (x / 12.92 at or below 0.04045, otherwise ((x + 0.055) / 1.055)2.4), and the contrast ratio as (L1 + 0.05) / (L2 + 0.05). Our app.js still uses the older threshold 0.03928. WCAG notes the change "has no practical effect", and our check found that none of the 256 possible 8-bit channel values falls between the two thresholds, so every ratio comes out the same. Ratios are rounded to two decimals, as the tools display them.

Lightness is not luminance. HSL lightness is the average of the largest and smallest channel. It says nothing about how bright a colour looks:

Bar chart. Yellow, cyan, green, red and blue all have HSL lightness 50 percent, but their relative luminance runs from 0.9278 for yellow to 0.0722 for blue.
Computed with the site's own contrast code.
ColourHSL lightnessRelative luminanceOn whiteOn black
#FFFF0050%0.92781.07:119.56:1
#00FFFF50%0.78741.25:116.75:1
#00FF0050%0.71521.37:115.3:1
#FF000050%0.21264:15.25:1
#0000FF50%0.07228.59:12.44:1

Results

All examples start from #7C3AED, the purple this site uses for links and buttons.

Tint and shade scale

The tint and shade generator moves each channel a fixed share of the way to white or black. Ten equal steps:

Twenty-one swatches from black to white through #7C3AED. Every shade, the base and tint T1 reach 4.5 to 1 on white; tints T2 and lighter do not.
Computed with the tint-shade tool's own functions.
StepTintOn whiteShadeOn white
1 (10%)#894EEF4.77#7034D56.69
2 (20%)#9661F13.98#632EBE7.88
3 (30%)#A375F23.29#5729A69.24
4 (40%)#B089F42.72#4A238E10.93
5 (50%)#BE9DF62.25#3E1D7712.75
6 (60%)#CBB0F81.89#32175F14.75
7 (70%)#D8C4FA1.59#25114716.8
8 (80%)#E5D8FB1.35#190C2F18.5
9 (90%)#F2EBFD1.16#0C061819.91
10 (100%)#FFFFFF1#00000021

The base is 5.70:1 on white. Equal mixing steps are not equal contrast steps: the first shade adds about 1 to the ratio, the ninth about 1.4, and the tenth step of each scale is pure white or pure black.

Gradient midpoint: sRGB vs Oklab

Two gradients from #2563EB to #F59E0B. In sRGB the midpoint is #8D817B, a grey brown with Oklab chroma 0.017; in Oklab it is #938EA4 with chroma 0.033.
Computed, then confirmed by rendering the CSS in Chromium 148.
CSSMidpoint computedMidpoint renderedOklab chroma
linear-gradient(to right, #2563EB, #F59E0B)#8D817B#8D807B0.017
linear-gradient(in oklab to right, #2563EB, #F59E0B)#938EA4#938DA30.033

CSS Color 4 says hex, named, rgb(), hsl() and hwb() colours interpolate "in gamma-encoded sRGB space" by default, which is why the plain gradient passes through grey. Both midpoints are low in chroma for this nearly opposite pair; Oklab keeps about twice as much.

Mixing one pair three ways

#FFD700 and #1E90FF averaged in RGB give #8FB480, averaged in HSL give #0FFF39, and multiplied as filters give #1E7900.
Computed. Only the RGB average is what the colour mixer outputs.

The colour mixer averages the red, green and blue values. Averaging hue, saturation and lightness instead, going the short way round the hue circle, gives a far more saturated green. Multiplying the channels, a simple model of two filters laid on each other, gives a dark green closer to what people expect from blue and yellow paint, but it is still not a pigment model, so real paint will differ.

Harmonies

Complementary, analogous, triadic and monochromatic sets generated from #7C3AED, each swatch labelled with its contrast ratio on white.
Computed with the palette generator's own rules. The full table is in the CSV linked below.

The palette generator converts to HSL, rotates the hue, and converts back with whole-number HSL values. That rounding is why its base swatch is #7C3BED rather than #7C3AED.

Colour vision deficiency simulation

Five colours shown as they are and under seven simulated deficiencies. Under simulated deuteranopia the green #16A34A and red #DC2626 become #958951 and #8F801B.
Computed with the colour blindness simulator's own code.

The simulator uses the matrices from Machado, Oliveira and Fernandes (2009), at severity 1.0 for the three dichromacies and 0.6 for the anomalous forms, and applies them to linearised sRGB values. The paper's project page does not state whether the RGB values should be linear; that is our implementation's choice. Achromatopsia is shown as relative luminance only. Limits: the model describes typical cases of each type, real people vary in severity, and the output is only as accurate as the screen showing it.

As a check of what it shows: green #16A34A and red #DC2626 are 0.341 apart in Oklab, but 0.05 apart once both are simulated for deuteranopia.

Recovering a logo's colours

Test logo: a purple circle #7C3AED, the word ACME in dark navy #1E1B4B and an amber bar #F59E0B on white.
The test logo used, drawn by script with known colours. It is not a real company's logo.
File loaded into the pickerClicked circle centreClicked just inside the edgeDominant colours listed
PNG, 600 px#7C3AED#7C3AED#FFFFFF #8040E0 #FFA000 #202040 #E0E0E0
JPEG, quality 0.9#7B3AEC#7344C6#FFFFFF #8040E0 #FFA000 #202040 #FFFFE0
JPEG, quality 0.6#7C3BEF#7144BD#FFFFFF #8040E0 #FFA000 #202040 #8040FF
PNG, 1600 px (scaled to 800)#7C3AED#7C3AED#FFFFFF #8040E0 #FFA000 #202040 #FFE0A0

Clicking returns the exact pixel. The dominant colour list rounds every channel to a multiple of 32, so it shows #8040E0, never the real #7C3AED.

Rounding between formats

Our converters show HSL and CMYK as whole numbers. Of 2,396,746 colours tested (every seventh 24-bit colour), 89.2 percent did not convert back to the same hex from whole-number HSL, by up to 4 levels in one channel, and 87.3 percent did not survive whole-number CMYK. #7C3AED becomes hsl(262, 83%, 58%), which converts back to #7C3BED.

Rounded contrast ratios

The colour picker shows contrast against white and black rounded to two decimals, with no pass or fail. Of 5,592,406 colours tested (every third 24-bit colour), 3,081 are shown as 4.5:1 or more against white while their unrounded ratio is below 4.5:1. #0071F4 is shown as 4.5:1 but is 4.4983:1, which fails AA for normal text. The contrast checker compares the unrounded ratio, so it reports these pairs as failing.

Palettes in our articles

The script also found 115 hex colours written in the text of 14 articles and computed each one's contrast on white and black. They are in the CSV below.

Tool behaviour checks

On 10 November 2026 we fixed tool bugs found by the checks above, then drove each fixed page in headless Chromium 148 like a user would: typing values, clicking buttons and reading what the page shows and what its copy buttons put on the clipboard.

What is not tested

The data

Get fresh reads straight to your inbox

Get notified when we publish new articles. Unsubscribe anytime.