Set foreground colour to provide a higher contrast with dark background colours.

[expired user #8393]'s profile image [expired user #8393] posted 8 years ago in General Permalink

If you choose a dark background colour for the session, the black text is difficult to read.

Obviously, one solution is don't choose a dark background colour.

But, a nice enhancement would be to switch to white when the colour is dark.

There is a relatively simple formula to work out which is which, but I've always had good enough success with looking at the green value.

If the green value is < 50% use white, otherwise use black.

[expired user #8393]'s profile image [expired user #8393] posted 8 years ago Permalink

And also, if you choose a middling colour (so black text is visible), the grey values for the object size are unreadable.

kalvaro's profile image kalvaro posted 8 years ago Permalink

If you convert from RGB to HSL it's fairly trivial: you just need to check the lightness value.

Please login to leave a reply, or register at first.