Abstract color-vision simulation methodology workspace with original and simulated swatch rows, risk comparison markers, grayscale mode panels, and non-color cue tiles.

Short answer

Hue Codex applies fixed RGB transform matrices for protanopia, deuteranopia, tritanopia, and achromatopsia, then compares simulated swatches with Delta E style distance and WCAG text checks.

  • The simulator approximates full-condition views with fixed matrices; it is not a severity slider or clinical model.
  • Pair risks are ranked by simulated Delta E distance, with closer pairs flagged for review.
  • Best text recommendations are recalculated on simulated colors.
  • Simulation can reveal likely risks, but real accessibility still needs contrast, labels, icons, shape, position, and user context.

Standards status

These badges identify which parts of this methodology are standards-backed, draft-track, Hue Codex-specific, approximate, or dependent on browser behavior.

Approximation Hue Codex heuristic Standard
Approximation Model or estimate with known limits, including CMYK, color-vision simulation, image palette extraction, or CSS duotone output.
Hue Codex heuristic Hue Codex ranking, role hints, bands, labels, or workflow guidance rather than an external standard.
Standard Stable standard or standards-backed behavior used as authority, such as WCAG 2.2 and broadly implemented CSS Color 4 behavior.

Formulas, choices, heuristics, and limits

This separates standards-based formulas from Hue Codex implementation decisions, product heuristics, and known limitations for this methodology.

Standards-based formulas

Formula, threshold, syntax, or data behavior taken from a cited standard or standards-backed source.

  • WCAG contrast math is reused for simulated text and surface checks.
  • The cited WCAG guidance anchors the need for contrast and non-color cues.

Implementation choices

How Hue Codex chooses to parse, normalize, round, export, or sequence calculations.

  • Hue Codex applies fixed RGB transform matrices for protanopia, deuteranopia, tritanopia, and achromatopsia.
  • Simulated values are clamped back to displayable sRGB before downstream checks.
  • Duplicate colors are removed before pair risk review.

Hue Codex heuristics

Product rankings, bands, labels, suggestions, or role hints that are useful guidance but not external standards.

  • Collapse risk labels and hue-only risk rankings are Hue Codex screening heuristics.
  • Delta E cutoffs for pair risk are review bands, not clinical or accessibility standards.
  • Best text recommendations on simulated colors are guidance for further review.

Known limitations

Caveats, edge cases, browser dependencies, approximations, or contexts the method does not prove.

  • Simulation is approximate and does not represent every person or severity level.
  • The model does not account for display calibration, viewing distance, lighting, eye conditions, or adaptation.
  • Passing simulation checks does not prove accessibility; meaning still needs labels, shape, position, and context.

Simulation modes

Approximation Browser-dependent

Hue Codex includes protanopia, deuteranopia, tritanopia, and achromatopsia modes. The selected matrix is applied to each sRGB color and the result is clamped back to displayable sRGB.

Duplicate HEX values are removed before pair comparison so the review focuses on distinct palette entries.

Risk ranking

Hue Codex heuristic Approximation

For each pair, Hue Codex calculates original Delta E 76 and simulated Delta E 76. A pair is flagged as likely collapse below 4, needs non-color cues below 8, review in context below 14, and distinct signal at higher distances.

Hue-only risks are pairs that begin visually separated but become close under the selected simulation. These are especially important for charts, status indicators, and selected states.

Text and contrast checks

Standard Hue Codex heuristic

Each simulated swatch receives a best black/white/text-candidate recommendation and WCAG contrast score. This catches cases where a simulated color remains distinct but becomes a poor surface for text.

Limits

Approximation Browser-dependent
  • The model is approximate and does not represent every person with color-vision differences.
  • The tool does not model display calibration, viewing distance, lighting, eye conditions, or individual adaptation.
  • Passing simulation checks does not prove accessibility.
  • Critical information should never depend on hue alone.

Validation checks

Hue Codex heuristic Approximation
Simulation QA checks.
Check Expected behavior
Two identical colors Pair ranks as collapse risk
Red/green-heavy pairs in red-green modes Review or collapse risk is likely
Achromatopsia mode Output depends primarily on lightness
Export caveat Reports state that simulation is approximate

Simulation pseudocode

Approximation Hue Codex heuristic Standard

Hue Codex applies fixed matrices directly to encoded 8-bit sRGB channels, then rounds and clamps back to displayable sRGB. It does not linearize before these matrix transforms.

CVD matrix transform and risk ranking
matrices:
  protanopia =
    [[0.567, 0.433, 0    ],
     [0.558, 0.442, 0    ],
     [0,     0.242, 0.758]]
  deuteranopia =
    [[0.625, 0.375, 0  ],
     [0.700, 0.300, 0  ],
     [0,     0.300, 0.7]]
  tritanopia =
    [[0.950, 0.050, 0    ],
     [0,     0.433, 0.567],
     [0,     0.475, 0.525]]
  achromatopsia =
    [[0.299, 0.587, 0.114],
     [0.299, 0.587, 0.114],
     [0.299, 0.587, 0.114]]

simulate(hex, matrix):
  r, g, b = hex_to_rgb(hex)  # encoded sRGB 0..255
  r2 = r*matrix[0][0] + g*matrix[0][1] + b*matrix[0][2]
  g2 = r*matrix[1][0] + g*matrix[1][1] + b*matrix[1][2]
  b2 = r*matrix[2][0] + g*matrix[2][1] + b*matrix[2][2]
  return rgb_to_hex(round_and_clamp(r2, g2, b2))

rank_pair_risks(colors, mode):
  entries = unique colors mapped to simulated HEX
  for each unordered pair:
    original_delta = delta_e_76(original_a, original_b)
    simulated_delta = delta_e_76(simulated_a, simulated_b)
    label = simulated_delta < 4 ? collapse
          : simulated_delta < 8 ? non_color_cues
          : simulated_delta < 14 ? review
          : distinct
  sort pairs by simulated_delta ascending
  hue_only_risk = original_delta >= 12 and simulated_delta < 8

Reproducible test vectors

Approximation Hue Codex heuristic

These vectors validate the fixed RGB transform matrices and final sRGB clamping used by the simulator.

Color-vision simulation matrix vectors.
Input Expected output Notes
Protanopia matrix applied to #FF0000 #918E00 Matrix result rounded and clamped to sRGB
Deuteranopia matrix applied to #FF0000 #9FB300 Matrix result rounded and clamped to sRGB
Tritanopia matrix applied to #0000FF #009186 Matrix result rounded and clamped to sRGB
Achromatopsia matrix applied to #4169E1 #6B6B6B Equalized grayscale-style RGB result

Sources and standards

These references anchor the public standards and formats used by Hue Codex. Status badges distinguish stable standards, drafts, Hue Codex heuristics, approximations, and browser-dependent behavior.

Tools using this methodology

These Hue Codex tools link to this methodology because they depend on the formulas, assumptions, limits, or data policy described here.