Farbsprache
DeutschDE

How Farbsprache calculates

Which formulas the page uses, how it rounds, what it checks and what it does not.

Color space and matrices

Farbsprache calculates in sRGB as defined in IEC 61966-2-1 (ICC, sRGB). The transfer function has a linear segment up to 0.04045 (encoded) or 0.0031308 (linear). Values outside 0 to 1 are mirrored at zero, as CSS Color 4 specifies.

All matrices come from the sample code of CSS Color 4, CRD 2026-10-09 (CSS Color 4): the conversion between sRGB, Display P3 and XYZ as exact fractions, the OKLab matrices as 16-digit decimals. The page does not mix in the matrices from Björn Ottosson's blog post (Ottosson 2020).

OKLCH is OKLab in polar coordinates: lightness L, chroma C and hue h. If the chroma is at most 0.000004, a color has no hue. The page then does not show one and calculates with 0.

Linear sRGB to XYZ (D65), fractions from CSS Color 4:

[ 506752/1228815,  87881/245763,  12673/70218 ]
[ 87098/409605,  175762/245763,  12673/175545 ]
[ 7918/409605,  87881/737289,  1001167/1053270 ]

Gamut mapping

The page maps colors outside sRGB with the binary search with local MINDE, exactly as in the pseudocode of CSS Color 4: color difference in OKLab, just noticeable difference 0.02, precision 0.0001. Then every channel is rounded to 8 bits.

Browsers may choose among three methods (CSS Color 4, 14.2). A browser may therefore show a color outside sRGB slightly differently. The check always uses the page's own 8-bit value, and exactly this value is in the export.

Contrast

The page calculates contrast as defined in WCAG 2.2 (WCAG 2.2, 1.4.3). The relative luminance is Y = 0.2126 · R + 0.7152 · G + 0.0722 · B with linearized channels (WCAG 2.2, relative luminance). The contrast is (Y of the lighter color + 0.05) / (Y of the darker color + 0.05).

The value is compared with the threshold without rounding (Understanding 1.4.3). It is shown truncated to two decimals, never rounded up. Gray #777777 on white has 4.47:1 and so misses 4.5:1.

The thresholds: 4.5:1 for text, 3:1 for large text from 24 px or from 18.67 px in bold and for controls and graphics, 7:1 for enhanced contrast. That bold means weight 700 is a convention, WCAG does not define it.

Everywhere the page rounds to the unfavorable side: contrast and distances are truncated, a required opacity is rounded up.

Grayscale

The grayscale of a color is the neutral gray with the same luminance Y as defined in WCAG. Two grayscale values therefore have exactly the contrast of their originals. The grayscale distance is the difference of ∛Y times 100. For a neutral gray, ∛Y is exactly the OKLab lightness, so it uses the same scale as the color difference.

The OKLCH lightness of a colorful color is something else. Blue #0000FF has the OKLCH lightness 0.452, its grayscale value is 0.416. Wherever the page shows L, it says OKLCH lightness and never grayscale.

The gray that is shown is rounded to 8 bits. This shifts Y + 0.05 of a color by up to 0.8% and the contrast of two shown grays by up to 1.6% compared with the originals. Measuring through ∛Y keeps the contrast, only the display hex differs. The build calculates both values over all 8-bit rounding boundaries.

Color vision deficiency

The page simulates protanopia and deuteranopia after Viénot, Brettel and Mollon 1999, tritanopia after Brettel, Viénot and Mollon 1997 with two half-planes. The matrices are taken verbatim from a public domain library under the Unlicense (libDaltonLens). They act on linear sRGB, and the result is clamped to 0 to 1.

For measurements the simulated color goes to OKLab without rounding. Only the display rounds it to 8 bits. So distances do not depend on rounding.

All models describe strong forms for an average observer (DaltonLens). Tritanopia is very rare (MedlinePlus) and hardly validated (DaltonLens). The page shows it, but it enters no optimization and no finding above a note.

The model by Machado, Oliveira and Fernandes (Machado 2009) provides matrices for milder forms as well. At full severity they differ from Viénot, and feedback from people with color vision deficiency ranks them lower for dichromacy (DaltonLens). A severity slider therefore only comes in v1.1, with its own label.

Matrices on linear sRGB (each row gives a channel), from libDaltonLens:

protanopia
[ 0.11238,  0.88762,  0.00000 ]
[ 0.11238,  0.88762,  -0.00000 ]
[ 0.00401,  -0.00401,  1.00000 ]

deuteranopia
[ 0.29275,  0.70725,  0.00000 ]
[ 0.29275,  0.70725,  -0.00000 ]
[ -0.02234,  0.02234,  1.00000 ]

tritanopia (m1, m2, n)
[ 1.01277,  0.13548,  -0.14826 ]
[ -0.01243,  0.86812,  0.14431 ]
[ 0.07589,  0.80500,  0.11911 ]

[ 0.93678,  0.18979,  -0.12657 ]
[ 0.06154,  0.81526,  0.12320 ]
[ -0.37562,  1.12767,  0.24796 ]

[ 0.03901,  -0.02788,  -0.01113 ]

Distances and reference values

A distance is the Euclidean color difference in OKLab times 100, measured between the simulated colors. It is shown with one decimal, truncated.

The only fixed threshold is 2: below it, two colors practically coincide. CSS Color 4 sets this just noticeable difference as a parameter for gamut mapping, without viewing conditions (CSS Color 4). The page therefore treats it as a convention.

For charts there is no established limit. The page therefore gives reference values: Okabe-Ito reaches 7.9, a simple rainbow of seven HSL hues reaches 2.8. Each is the smallest value with normal vision, deuteranopia and protanopia.

The build calculates the table from the data sets. For each palette and view it shows the smallest distance between two colors and the pair that has it.

Palettenormal visionprotanopiadeuteranopiatritanopiagrayscale
Okabe-Ito, seven colors without black15.5#E69F00/#D55E009.0#0072B2/#CC79A77.9#009E73/#CC79A78.4#E69F00/#CC79A70.6#E69F00/#56B4E9
Paul Tol, bright10.6#66CCEE/#BBBBBB7.1#66CCEE/#BBBBBB8.1#66CCEE/#BBBBBB1.1#4477AA/#2288330.4#CCBB44/#BBBBBB
Paul Tol, muted12.8#CC6677/#AA44999.2#CC6677/#1177335.6#CC6677/#44AA999.2#CC6677/#AA44991.7#117733/#AA4499
simple HSL rainbow, seven hues8.9#49FF00/#00FF925.8#FFDB00/#49FF002.8#FFDB00/#49FF002.3#49FF00/#00FF920.2#49FF00/#00FF92

Projector and scrim

The projector model follows Texas Instruments (TI DLPA088), simplified: P(Y) = Y · (1 − 1/N) + 1/N + a. N is the native contrast of the projector, here 2,000. a is the ambient light relative to the projector white of 500 lx: dark 5 lx, dimmed 100 lx, bright 300 lx. The source only uses 100 lx and calls it a dimmed conference room. The other two levels are assumptions of Farbsprache.

The projected contrast is P(Y of the lighter color) / P(Y of the darker color), without the 0.05 term from WCAG, because the ambient light takes over that role. In a dimmed room, black on white reaches 5.98:1, #767676 on white reaches 3.14:1 and #595959 on white reaches 3.99:1. In a dark room, black on white reaches 96.19:1, in a bright room 2.66:1.

Limits: linear reproduction, no gamma curve of the projector, no screen gain. The model shows how much headroom is needed, not what a particular projector does.

The scrim uses the worst case (Failure F83): if the text is lighter than the scrim, it sits over a pure white pixel, otherwise over a black one. Blending happens in encoded sRGB like in the browser, c = α · s + (1 − α) · p. The page finds the smallest opacity by binary search, rounds it up to whole percent and checks the result in floating point and in 8 bits.

White on a black scrim needs 42% for 3:1, 54% for 4.5:1 and 66% for 7:1. Black on a white scrim needs 46% for 4.5:1, white on a scrim in #11697A needs 85%.

Evidence levels

Every rule and every entry carries an evidence level. It says how well a statement is backed, not how important it is.

Standard
is stated like this in a binding rule, such as WCAG 2.2.
Research
backed by studies or expert sources, with a note on how well.
Convention
holds because it is agreed or common. Often still the right choice.
Unproven
no source found, or disproved.

Research also carries a strength: well supported means several independent or replicated findings, partly supported means single studies, small or inconsistent effects, or only an abstract that was read.

W3C techniques, failures and understanding documents are informative. They appear in the source line marked “informative” and never support a standard on their own.

Own settings carry the level Convention and the note “Farbsprache setting”.

Every source has an access label: full text, abstract or search snippet only. What was not read is listed with the source under “Not checked”.

Finding levels on Check palette

Findings carry their own level, separate from the evidence level. It always appears as a symbol and a word, never as color alone.

■ Fails
A normative threshold is missed, and the roles are confirmed.
▲ Check
A normative threshold is missed, but a condition is open: the roles are not confirmed, the color may not be used as text, or the color is not the only thing that makes the element recognizable.
● Note
Convention, research, reference value or information.
✓ Passes
The threshold is met.
FindingEvidence levelSource
Text on a surface check-textStandard

Sources: WCAG 2.2, 1.4.3 (full text)

Line, border, graphic check-nontextStandard

Sources: WCAG 2.2, 1.4.11 (full text)

Colors coincide check-duplicatesConvention

Sources: CSS Color 4 (full text)

Close under color vision deficiency check-cvdConvention Farbsprache setting

Sources: DaltonLens (full text) · libDaltonLens (full text)

Close in grayscale check-grayConvention

Sources: Datawrapper 2018 (full text) · WCAG 2.2, relative luminance (full text)

No gray check-neutral-missingConvention

Sources: Few 2008 (full text) · Datawrapper 2018 (full text)

Outside sRGB check-gamutStandard

Sources: CSS Color 4, 14.2 (full text) · CSS Color 4 (full text)

Transparency check-alphaConvention

Sources: WCAG 3.0, working draft (full text)

Findings with a conventional threshold are always notes. “Fails” requires a standard and confirmed roles.

With roles, the page checks the pairs given by the roles, and distances only between signal colors (accent, status) and colors without a role. Without roles, it checks every color on the chosen background as text and as a graphic.

For contrast findings the fix searches the nearest lightness with the same hue and chroma that meets the threshold, away from the background. Hue and chroma of the suggestion stay as far as sRGB can show them at the new lightness: otherwise gamut mapping lowers the chroma, and if no lightness is enough, the solver lowers it step by step. For distance findings it moves the lighter color of the pair in steps of 0.01 between L 0.20 and 0.95. It takes the candidate closest to the original that reaches the reference value and makes no contrast check worse: a check that is met stays met, a check that is missed does not drop further.

What is not checked

The page does not check these points. Every task page lists the ones that apply to it under “Not checked”.

  • font sizes and font weights of your implementation
  • transparency, images, gradients and shadows in your implementation
  • colors on real, uncalibrated screens
  • Night Shift and True Tone
  • mild forms of color vision deficiency (anomalies)
  • focus order and keyboard use
  • whether series are labeled
  • what an image model makes of the prompt
  • CMYK and print profiles

Farbsprache settings

Farbsprache set these values itself. They have reasons, but no studies behind them.

  • Convention Farbsprache setting Muted text and strong borders, and on slides also text and lines, plan 10% of headroom above their threshold. So small changes do not push them below it right away.
  • Convention Farbsprache setting Status colors search their lightness within fixed bands. Without bands the search pushed error and info so dark that they no longer read as status colors.
  • Convention Farbsprache setting If the status colors lie closer together under color vision deficiency than the Okabe-Ito colors (smallest distance 7.9), the page shows a note. Okabe-Ito is a reference value here, not an established limit.
  • Convention Farbsprache setting In dark mode the chroma of the accent drops to 85% of the light value, so it does not look harsh on a dark background.
  • Convention Farbsprache setting Generated palettes set the dark background to a dark gray instead of black. This follows Material Design (Material Components, Dark theme), there is no evidence that it reads better. This site itself uses #0B0B0B in dark mode, like its sister project Bildsprache.
  • Convention Farbsprache setting If your color lies beyond the surfaces, such as white in light mode or black in dark mode, the search for the link color does not start at its lightness. It starts at L 0.8 in light mode and at L 0.4 in dark mode, and so finds the same limit as for a color just inside the surfaces.
  • Convention Farbsprache setting On slides the same applies to every role: if the start color lies on the wrong side of the surfaces, the search starts at medium lightness. It looks for the same limit, so very light and very dark colors of your own stay solvable.
  • Convention Farbsprache setting The projector model uses 5 lx of ambient light for a dark room and 300 lx for a bright room. Farbsprache assumed both values. Texas Instruments only uses 100 lx in a dimmed conference room (TI DLPA088).
  • Convention Farbsprache setting Image prompts use a fixed English color vocabulary without object names, so that a model does not paint the color name into the picture as an object.
  • Convention Farbsprache setting From 6 series on, the page recommends direct labels. Wilke only advises it above about eight categories (Wilke, color pitfalls), the page cuts earlier.
  • Convention Farbsprache setting On a dark background, gradients let the lighter step stand for more, because it stands out more there. Schloss and colleagues advise darker for more if a scale should read the same on any background (Schloss et al. 2019). So the legend always shows the direction.
  • Convention Farbsprache setting Check palette compares distances with Okabe-Ito. This replaces a missing established limit and is not a standard.

Why no APCA, why no harmony score

APCA is a newer contrast method. The page does not use it, for two reasons. The license ties the code to the W3C working group and to web content, requires a separate license for commercial use, forbids changes to the core and the constants and notes pending patents (APCA license). And it is not normative: the current WCAG 3 draft leaves the contrast algorithm open, and the word APCA does not appear in it (WCAG 3.0, working draft).

The page does not calculate a harmony score after Ou and Luo. The method is part of a US patent that Google Patents lists as active (US 8,427,498 B2). Whether such a score on a website touches the claims was not checked.

Screen and surroundings

Every number applies to sRGB on a correctly set screen. Real screens are often not calibrated. Night Shift shifts colors toward warm in the evening (Apple, Night Shift), True Tone adapts them to the ambient light (Apple, True Tone). Both change what you see, not what the page calculates.

Very colorful colors look lighter than their lightness says (Helmholtz-Kohlrausch effect). This was not researched here and affects OKLCH as well.

Python and JavaScript

The color core exists twice: in Python to build the site and in JavaScript for your own colors. Both read the same constants and pass the same 224 test vectors.

A parity test runs all starter palettes and 60 fixed inputs in both languages. Hex values must match exactly, decimals up to one billionth. The check page compares its output for the example byte by byte.

Only Python calculates the starter palettes, at build time. The browser shows them from the build data and only calculates what you enter yourself.

The site's own theme

This site uses the Swiss theme of Bildsprache unchanged: black and white, red only as a control signal. In light mode the text is #0B0B0B on #FFFFFF (19.68:1), in dark mode #FFFFFF on #0B0B0B (19.68:1).

That dark surfaces should use dark gray instead of black is a convention after Material Design (Material Components, Dark theme), without evidence on readability. The generated palettes still use a dark gray in dark mode, as a setting for generated palettes. The site itself follows the theme of Bildsprache.

Unchecked items and status

Status October 31, 2026. The site is published, but not all of these checks are done yet. Each one says whether it is done, partly done or open:

  • Check the Tailwind v4 export once in a real Tailwind 4 installation and note version and date. Status: done on 2026-10-31. With tailwindcss and @tailwindcss/cli 4.3.3 the export of each of the 22 starter palettes compiles without a warning. Every class bg-*, text-* and border-* is in the generated CSS. There every variable has exactly the hex value of the palette, in every mode. The export stayed unchanged. CI repeats the check in a separate job (tools/tailwind_check.py).
  • Check the MINDE test vectors of the gamut mapping against color.js or Coloraide. Status: done on 2026-10-11. Coloraide 8.13 (method minde-chroma) gives the same hex for all three vectors. According to the test vector file colorjs.io 0.7.1 agrees as well, which was not repeated here.
  • Check the Office names and menu paths for PowerPoint, Keynote and Google Slides against the vendor documentation. Menu paths, status per app according to the presentation task: PowerPoint 2026-10-11, Keynote 2026-10-11, Google Slides 2026-10-11. Status: partly done. The menu paths are checked, as are the order of the Office color scheme (Microsoft, color scheme) and the names of the hyperlink colors (Microsoft, hyperlink colors). Open are the German names “Dunkel 1” to “Hell 2” and the order in the PowerPoint dialog. Apple does not say explicitly whether the Colors window for Keynote accepts hex values (Apple, Colors window).
  • Open the documentation addresses of the image models and update the status per model. Status per model according to data/models.json: FLUX.2 2026-10-11, Ideogram 3.0 2026-10-11, Recraft 2026-10-11, Midjourney 2026-10-04 (archived copy only), gpt-image 2026-10-11. Status: done on 2026-10-11. The Midjourney vendor docs answer with HTTP 403, only an archived copy was read there.
  • Three tests with lay people on a phone: one task each copied in under two minutes. Status: open
  • Confirm the American spelling color in English. Status: done on 2026-10-12. Confirmed: English stays with color.
  • Check whether EN 301 549 V4.1.1 is now in the Official Journal of the EU, and update the page if so. Status: open

The expected values of the color core are in data/testvectors.json: some come from the sources, some from a separate Python calculation that is independent of the build. If the build differs, that is a finding and no reason to change the number.