This tool computes the ‘colour contrast’ of two colours using both the relative luminance ratio algorithm from Web Content Accessibility Guidelines (WCAG) and the lightness contrast from the newer Accessible Perceptual Contrast Algorithm (APCA).
The conformance level for a contrast value is shown within square brackets in the output field labels: A, AA, or AAA. The legal requirement is AA.
There are two modes: text and graphic. Text mode measures the contrast of a text foreground colour against a background colour. The WCAG conformance criteria (1.4.3 and 1.4.6) depend on the font size and font weight. Graphic mode measures the contrast of two adjacent colours, not necessarily a foreground and a background.
Note that APCA differentiates between light-on-dark and dark-on-light, so make sure you get the foreground/background right. There is no APCA conformance mapping for graphic mode.
You can specify colours in different ways:
Note that opacity values only make sense for foreground colours.
APCA lightness contrast values are negative for light-on-dark combinations, but the absolute values are equivalent. Lc 60 and Lc −60 represent the same perceived contrast.