0

I would like to have fields for which background color will be generated from their content (this will be in javascript but this does not matter I believe for my question).

I will therefore have, for instance, a background of hsl(218, 52%, 83%) (some kind of pale violet). This field will also have text in it, and I would like the text to have as much contrast as possible relative to the background.

Is there a concept of "color opposite to a given HSL one"?

WoJ
  • 27,165
  • 48
  • 180
  • 345
  • 1
    I found a similar question [https://stackoverflow.com/questions/1165107/how-do-i-invert-a-colour](https://stackoverflow.com/questions/1165107/how-do-i-invert-a-colour) – Ruthvik Nov 13 '21 at 13:26
  • Does this answer your question? [Generate Random Color distinguishable to Humans](https://stackoverflow.com/q/10014271/11683) – GSerg Nov 13 '21 at 13:29

0 Answers0