On one of pages we're currently working on users can change the background of the text displayed.
We would like to automatically alter the foreground colour to maintain reasonable contrast of the text.
We would also prefer the colour range to be discretionary. For example, if background is changing from white to black in 255 increments, we don't want to see 255 shades of foreground colour. In this scenario, perhaps 2 to 4, just to maintain reasonable contrast.
Any UI/design/colour specialists/painters out there to whip out the formula?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…