I would like to include a warning in our product when a user picks a background color that is not contrasting enough with the foreground color. Like say, cream on white background? Or red on maroon background?
We only work with colors by there hex values, valid color notations are: #+hex string <=6 chars, obviouslly padded with zerros for the missing values, and adhering to the standard of #rrggbb
So how would I do it? Compare the colors based on their decimal value and define a minimum treshold? Do so for each of the colors (r, g, b)?
Any suggestions, or real life experience?
Ramses aka x_terminat_or_3