What does Audience-Adaptive Interfaces conclude, in numbers, about “The Exact Arithmetic of Contrast: sRGB Linearisation, Dark Themes and High-Contrast Themes”?
Answer: Chapter 3 computes sRGB relative luminance and contrast exactly; the fashion template's decorative grey reaches only 3.55 and must be lightened, and the old and new linearisation thresholds change no verdict for any 8-bit colour.
Scope of the numbers: Parameters are illustrative, all calculations come from the book's programs, and no real site is described. This is not legal advice and not personalised business advice.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 3.55
| pair fg bg ratio AA-4.5 large-3 | ||||
| elder body | #1A1A1A #FFFFFF | 17.40 | pass | pass |
| elder button | #FFFFFF #0B5394 | 7.84 | pass | pass |
| fashion body dark | #E8E8F0 #121218 | 15.31 | pass | pass |
| fashion accent btn | #121218 #7CF5C4 | 13.96 | pass | pass |
| fashion grey hint | #6B6B78 #121218 | 3.55 | reject | pass |
| property body | #1F2933 #F5F7FA | 13.75 | pass | pass |
| property link | #0B5CAD #FFFFFF | 6.67 | pass | pass |
| narrative body | #F2E9DC #2B2118 | 13.10 | pass | pass |
| default muted | #9AA0A6 #FFFFFF | 2.64 | reject | reject |
| black on white: 21.00 | ||||
Show the full program
# Chapter 3. p31: WCAG 2.2 relative luminance and contrast ratio, exact.
# Channel c in [0, 1]: linear = c / 12.92 if c <= 0.04045, otherwise
# ((c + 0.055) / 1.055) ** 2.4; L = 0.2126 R + 0.7152 G + 0.0722 B;
# ratio = (L1 + 0.05) / (L2 + 0.05) with L1 the lighter colour.
# Bars: 4.5 normal text, 3.0 large text (18 pt, or 14 pt bold).
# Colour pairs are the book's own illustrations for five templates;
# rows marked "reject" are shown only to be recognised and refused.
import math
def lin(c8):
c = c8 / 255.0
return c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4
def lum(hexrgb):
r, g, b = (int(hexrgb[i:i + 2], 16) for i in (1, 3, 5))
return math.fsum([0.2126 * lin(r), 0.7152 * lin(g), 0.0722 * lin(b)])
def ratio(fg, bg):
a, b = lum(fg), lum(bg)
hi, lo = max(a, b), min(a, b)
return (hi + 0.05) / (lo + 0.05)
PAIRS = [
("elder body", "#1A1A1A", "#FFFFFF"),
("elder button", "#FFFFFF", "#0B5394"),
("fashion body dark", "#E8E8F0", "#121218"),
("fashion accent btn", "#121218", "#7CF5C4"),
("fashion grey hint", "#6B6B78", "#121218"),
("property body", "#1F2933", "#F5F7FA"),
("property link", "#0B5CAD", "#FFFFFF"),
("narrative body", "#F2E9DC", "#2B2118"),
("default muted", "#9AA0A6", "#FFFFFF"),
]
print("pair fg bg ratio AA-4.5 large-3")
for name, fg, bg in PAIRS:
r = ratio(fg, bg)
a = "pass" if r >= 4.5 else "reject"
l3 = "pass" if r >= 3.0 else "reject"
print("{:<19} {} {} {:>6.2f} {:<6} {}".format(
name, fg, bg, r, a, l3))
print("black on white: {:.2f}".format(ratio("#000000", "#FFFFFF")))Single source and citation
Fan, Y. (2026). Demographic Cognitive Segmentation, Elder-to-Gen-Z Interface Divergence and Audience-Adaptive Conversion UX (Version 1.0.0), Chapter 3: The Exact Arithmetic of Contrast: sRGB Linearisation, Dark Themes and High-Contrast Themes. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-363 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026363,
author = {Fan, Yafu},
title = {Demographic Cognitive Segmentation, Elder-to-Gen-Z Interface Divergence and Audience-Adaptive Conversion UX},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · Year of Birth Is Not an Interface Variable: the Variance of Cohort Labels and Measurable Capabilities
- Chapter 2 · Hick and Fitts: an Account of Operating Time for Folded Menus and Linear Paths
- Chapter 4 · The Checkout Friction Funnel: Field Counts, Scan-to-Fill and the Product of Abandonment Rates
- Chapter 5 · Assortment Size and the Probability of Buying: the Uncertain Inverted U
- Chapter 6 · The Segmentation Engine: Observable Signals, Naive Bayes and a Cost Matrix for Misrouting
- Chapter 7 · Classical Sources: Teaching by Temperament in the Analects, Courtesy to Elders in the Book of Rites, and Aristotle on Young and Old Audiences
- Chapter 8 · Standard Operating Templates and Checker Specification: the Weekly Audience-Template Ledger, Pre-Registered Tests and Refutation Conditions