The hsl()
functional notation expresses an sRGB color according to its hue, saturation, and lightness components. An optional alpha component represents the color's transparency.
Defining complementary colors with hsl()
can be done with a single formula, as they are positioned on the same diameter of the color wheel. If theta
is the angle of a color, its complementary one will have 180deg-theta
as its hue coordinate.