Color choices that look fine to one reader can be illegible to another. The Web Content Accessibility Guidelines (WCAG) make legibility measurable through a contrast ratio between a foreground and a background color. AccessibleColors brings that measure to the Wolfram Language and builds a few practical tools on top of it. This tech note walks through a typical workflow: measure contrast, read off a conformance level, pick legible text, and repair a color that falls short.
returns a number from 1 (the two colors are identical) to 21 (black on white). It depends only on relative luminance, so it is symmetric in its two arguments.