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 #FFFFFF17.40passpass
elder button#FFFFFF #0B53947.84passpass
fashion body dark#E8E8F0 #12121815.31passpass
fashion accent btn#121218 #7CF5C413.96passpass
fashion grey hint#6B6B78 #1212183.55rejectpass
property body#1F2933 #F5F7FA13.75passpass
property link#0B5CAD #FFFFFF6.67passpass
narrative body#F2E9DC #2B211813.10passpass
default muted#9AA0A6 #FFFFFF2.64rejectreject
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