Summary
The Accessibility Evaluation and Repair Tools (AERT) colour contrast algorithm was never a recommendation. As the luminosity contrast ratio algorithm is recommended with WCAG 2.0, it is now the main method of testing colour contrast on Juicy Studio.
Author: Gez Lemon
AERT Suggested Algorithm
The 26th of April 2000 working draft for AERT contains a suggested algorithm to calculate the contrast of foreground and background colours, based on the YIQ colour space previously used by the NTSC television standard:
Color brightness is determined by the following formula:
((Red value X 299) + (Green value X 587) + (Blue value X 114)) / 1000
Note: This algorithm is taken from a formula for converting RGB values to YIQ values. This brightness value gives a perceived brightness for a color.
Color difference is determined by the following formula:
(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))
A colour brightness difference of over 125
and a colour difference of over 500
is a pass using this algorithm.
Absence of an Official Algorithm
In the absence of any other published algorithm to determine colour contrast, I decided to use the proposed AERT algorithm to test for colour contrast. The algorithm was better than nothing, but there were problems with the algorithm failing colour combinations that were obviously good, and allowing colour combinations that were obviously poor.
The biggest problem with the AERT algorithm is that the colour difference was too strict and barred obviously good colour combinations. To get around this restriction, Hewlett Packard lowered the threshold to 400. The algorithm also allowed colour combinations that were obviously not good, such as #f80
and #00f
(bright blue on orange). The colour combination is difficult to read, yet passes the AERT algorithm. The difference in brightness is 127 (threshold is 125), and the difference in colour is 646 (threshold is 500).
Luminosity Contrast Ratio
The Luminosity Contrast Ratio algorithm, developed by Gregg Vanderheiden, Dave Kelso, and Aries Arditi at the Trace R&D Center has been adopted by WCAG 2.0. Success Criterion 1.4.3 requires the visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for the following:
- Large Text: Large-scale text and images of large-scale text have a contrast ratio of at least 3:1;
- Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content, have no contrast requirement.
- Logotypes: Text that is part of a logo or brand name has no minimum contrast requirement.
The luminosity algorithm provides much better results than the old AERT algorithm. The obviously poor colour combination of bright blue on an orange background (#f80 and #00f) yields a luminosity contrast ratio of 3.59:1 — a failure of success criterion 1.4.3, except for large text.
Colour Contrast Services
The old URL for the AERT colour contrast service on this website now redirects to the luminosity contrast ratio analyser (HTTP 301: moved permanently). The old AERT colour contrast analyser is still available, but through the new URL. The Juicy Studio Accessibility Toolbar and the Colour Contrast Analyser Firefox extensions will continue to include the AERT algorithm alongside the luminosity contrast ratio algorithm in the meantime.
Category: Accessibility.
[luminosity-contrast-ratio-main-colour-contrast-analyser.php#comment1]
That AERT colour difference calcualtion is crazy. It means that there are whole swathes of colour - for example all greys between 595959 and A6A6A6 - which can't be used as a background or foreground colour as there's no colour that contrasts enough with them.
Posted by Chris Hunt on
[luminosity-contrast-ratio-main-colour-contrast-analyser.php#comment2]
Not to be picky, but I think you meant:
A subtle difference of meaning.
I've observed the problem that Chris comments on which the AERT color difference calculation - it's certainly nice to be staying away from that particular problem...
Posted by Joe Dolson on
[luminosity-contrast-ratio-main-colour-contrast-analyser.php#comment3]
That's right. I wrote a script a few years ago that illustrated that problem by comparing example combinations with both algorithms.
Posted by Gez Lemon on
[luminosity-contrast-ratio-main-colour-contrast-analyser.php#comment4]
I originally had "not" instead of "now", which is a massive difference in meaning. Thanks for pointing it out, Joe.
Posted by Gez Lemon on