Contents

Translations

Colour Contrast

Note: It is highly recommended that WCAG 2.0's luminosity contrast ratio is used instead of this algorithm to test for colour contrast.

Guideline 2.2 of the Web Content Accessibility Guidelines 1.0 requires that foreground and background colour combinations provide sufficient contrast when viewed by someone having colour deficits, or when viewed on a black and white screen. Two colours provide good colour visibility if the brightness difference and the colour difference between the two colours are greater than a set range. They suggest a colour contrast algorithm, which is used in this test. The algorithm is under development, and may be likely to change. Any changes to their algorithm will be updated on this page.

This page is provided to allow you to check the contrast of two colours using the W3C's colour contrast algorithm by specifying the colours directly.

Colour Contrast Analyser

Colours

Colour Brightness Formula

The following is the formula suggested by the World Wide Web Consortium (W3C) to determine the brightness of a colour.

((Red value X 299) + (Green value X 587) + (Blue value X 114)) / 1000

The difference between the background brightness, and the foreground brightness should be greater than 125.

Colour Difference Formula

The following is the formula suggested by the W3C to determine the difference between two colours.

(maximum (Red value 1, Red value 2) - minimum (Red value 1, Red value 2)) + (maximum (Green value 1, Green value 2) - minimum (Green value 1, Green value 2)) + (maximum (Blue value 1, Blue value 2) - minimum (Blue value 1, Blue value 2))

The difference between the background colour and the foreground colour should be greater than 500.