Color Contrast - Brightness Calculator

Des Traynor wrote a very interesting article on Crimes against Web Usability 2 . He describes using a formula to calculate the difference in brightness between two colors. We took his ideas and formulas to build this brightness or contrast calculator.

Enter foreground and background colors below and the difference will be calculate. The sample text below shows the foreground and background colors entered.

Foreground Color
  Dec Hex
Red
Green
Blue
Brightness is
( (Red * 299) +
(Green * 587) +
(Blue * 114) ) / 1000
2.06
Background Color
  Dec Hex
Red
Green
Blue
Brightness is
( (Red * 299) +
(Green * 587) +
(Blue * 114) ) / 1000
219.305
Brightness difference is217.245

Sample Text

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec lacus magna, imperdiet a, sollicitudin sed, congue vitae, nisl. Ut id est. Quisque aliquam diam id tortor. Vivamus convallis, ligula eget fermentum mattis, risus pede mattis sapien, eu mollis eros erat a lacus. Cras vestibulum. Suspendisse luctus placerat metus. Nunc gravida. Vestibulum dictum. Donec ut massa. Cras accumsan, augue ut fringilla