"dev42" wrote:
... but to be able to have random colors that aren't too dark. I couldn't figure out how to do that in RGB.... easily. errr with pretty code! Yeah, that's it.
- Define
lightness = 0.3*R + 0.6*G + 0.1*B
- Make sure `lightness` is above some threshold (say 0.5)
- Rejoyce!
Actually there are 101 ways to do that, for example you can use max(R, G, B), R+G+B, R^2+G^2+B^2, min(R,G,B) + max(R,G,B) etc
Credit goes to @SquirrelTown, who draw my attention to the concept of "lightness", which made me read little on it.