Fixed bug in contrast checking algorithm.

Contrast checker would return the wrong color.