WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Color Contrast Formula

for

From: Andrew Kirkpatrick
Date: Mar 15, 2005 10:20AM


Tim,
> What is meant by max and min values?

When comparing two colors [e.g. (200, 100, 200) and (255, 0, 100)] the
formula would be:
color difference = (maximum(255,200) - minimum(255,200)) +
(maximum(100,0) - minimum(100,0)) + (maximum(100,200) -
minimum(100,200))
or
color difference = (255-200)+(100-0)+(200-100)

AWK

--
Andrew Kirkpatrick
WGBH National Center for Accessible Media
125 Western Ave.
Boston, MA 02134
E-mail: <EMAIL REMOVED>
617.300.4420