The Science of Digital Color Models & Human Perception
Color reproduction on digital screens is governed by additive RGB color mixing. By varying the intensity of Red, Green, and Blue subpixels from 0 to 255, displays can render up to 16.7 million distinct chromatic hues (24-bit TrueColor).
Relative Luminance and Contrast Calculation
The human eye is not uniformly sensitive to all wavelengths of light; our retinas perceive green light far more vividly than blue light. The WCAG 2.1 relative luminance formula accounts for this physiological asymmetry:
Luminance = 0.2126 * R_lin + 0.7152 * G_lin + 0.0722 * B_lin
The contrast ratio between two colors is then calculated as \((L_1 + 0.05) / (L_2 + 0.05)\), where \(L_1\) is the lighter color. Our tool automates these calculations in real time, making accessibility auditing straightforward during UI/UX prototyping.