Is there a formula for deriving readable text for a color?

Status
Not open for further replies.

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
Is there a math formula that can be used to determine if text will be readable when placed on a background of another, given color?

Let's say I pick color with value #009900, is there a way to safely choose a color that can be placed on it that will be legible?
 

Saint Nick

Lifer
Jan 21, 2005
17,722
6
81
Yes, it's called the complementary color. There are plenty of complementary color generators out there.
 

Ben90

Platinum Member
Jun 14, 2009
2,866
3
0
if green value >= 128 set opposite green value to 0
if red value >= 128 set opposite red value to 0
if blue value >=128 set opposite blue value to 0

if green value < 128 set opposite green value to 255
if red value < 128 set opposite red value to 255
if blue value < 128 set opposite blue value to 255

works everytime
 
Status
Not open for further replies.