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"?