Source: https://guthlabs.ai/docs/instruments/wcag-contrast-ratio-checker/implementation/

instrument implementation / implementation-contract

# WCAG Contrast Ratio Checker implementation

A source-bound implementation contract for WCAG Contrast Ratio Checker; deployment and executable qualification remain separate.

Status: **VERIFIED_CLEAN**Lifecycle: **implementation-contract**

## Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

**Record owner**: Guth Instruments

**Lifecycle**: verified-clean

**Evidence ID**: t5-023

**Effect**: Computation or source lookup only

## Input and validation requirements

An out-of-range sRGB input can make relative luminance equal -0.05 and force the contrast denominator to zero. The checker must validate channel ranges and reject such input rather than return Infinity, NaN, or a misleading pass/fail result.

## Required corrections

No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.

## Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

````
{
  "inputs": {
    "foreground": "#000000",
    "background": "#FFFFFF"
  },
  "expected_outputs": {
    "contrast_ratio": 21,
    "AA_normal": true,
    "AA_large": true,
    "AAA_normal": true,
    "AAA_large": true
  },
  "working": "Normalize black=(0,0,0), white=(1,1,1). Black linear channels=(0,0,0), so Lblack=0. White linear channels=(1,1,1), so Lwhite=0.2126+0.7152+0.0722=1. L1=1 and L2=0. Contrast=(1+0.05)/(0+0.05)=1.05/0.05=21.00. Compare: 21>=4.5, 21>=3, 21>=7, and 21>=4.5, so every result passes."
}
````

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/wcag-contrast-ratio-checker/>)[02**Mechanism**](<https://guthlabs.ai/docs/instruments/wcag-contrast-ratio-checker/mechanism/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/wcag-contrast-ratio-checker/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche5/tranche5-results.json`
