The APCA version in this repositiory is licensed to the W3/AGWG per the collaborative agreement.
Current Version: 0.0.98G-4g-w3-betafish
APCA is a contrast assessment method for predicting the perceived contrast between sRGB colors on a computer monitor. It has been developed as an assessment method for W3 Silver/WCAG3 accessibility standards relating to content for computer displays and mobile devices, with a focus on readability and understandability.
Usage:
First color must be text, second color must be the background.
Lc = APCAcontrast(sRGBtoY(textColor),sRGBtoY(backgroundColor));
Latest Lookup Table: November 17 2021
Additional documentation, including a plain language walkthrough, LaTeX math, and more are available at the SAPC repo.
These constants are for use with the web standard sRGB colorspace.
// 0.98G-4g-W3 constants (W3 license only):
Exponents = { mainTRC: 2.4, normBG: 0.56, normTXT: 0.57, revTXT: 0.62, revBG: 0.65, };
ColorSpace = { sRco: 0.2126729, sGco: 0.7151522, sBco: 0.0721750, };
Clamps = { blkThrs: 0.022, blkClmp: 1.414, loClip: 0.1, deltaYmin: 0.0005, };
Scalers = { scaleBoW: 1.14, loBoWoffset: 0.027,
scaleWoB: 1.14, loWoBoffset: 0.027, };
There is a working version with examples and reference material on the APCA site