Template:Color contrast/doc

Usage
The template computes color contrast between two RGB colors per WCAG 2.0. The value varies between 1 for identical colors to 21 for maximally contrasting colors (black and white).

The template accepts six unnamed parameters r1, g1, b1, r2, g2, b2 (in this order), representing the RGB color coordinates of the first and second colors. If six parameters are provided, then the template returns the contrast value as described above. There is an additional seventh parameter which can set various minimum contrast levels; if contrast is equal or greater than the provided value, the template will instead return "1" and "0" if not.

Alternatively, the template accepts two parameters representing the HEX codes of two colors, and returns same result.

Examples:

→   →    →    →    →    →