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?