# Generated by detroit
# See https://github.com/bourbonut/detroit/tree/main/api_maker

from functools import partial
from operator import is_not

class hsl:
    def __init__(self, content="hsl"):
        self.content = content

    def __repr__(self):
        return self.content

    def __str__(self):
        return self.content

    def __call__(self, *args):
        arguments = ", ".join(map(repr, args))
        return f"{self}({arguments})"

    def clamp(self):
        """
        .. code:: javascript

            d3.hsl(400, 2, 0.5).clamp() // {h: 40, s: 1, l: 0.5, opacity: 1}

        Source · Returns a new HSL color where the h channel is clamped to the range [0, 360),
        and the s, l, and opacity channels are clamped to the range [0, 1].

        See more informations `here <https://d3js.org/d3-color#hsl_clamp>`_.
        """
        return hsl(content=f"{self.content}.clamp()")

