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

from functools import partial
from operator import is_not

class interpolateColor:
    def __init__(self, content="interpolateColor"):
        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 gamma(self, gamma=None):
        """
        .. code:: javascript

            d3.interpolateRgb.gamma(2.2)("purple", "orange")

        Given that interpolate is one of interpolateRgb, interpolateCubehelix or
        interpolateCubehelixLong, returns a new interpolator factory of the same type using the
        specified gamma. See Eric Brasseur’s article, Gamma error in picture scaling, for more
        on gamma correction.

        See more informations `here <https://d3js.org/d3-interpolate/color#interpolateColor_gamma>`_.
        """
        arguments = ", ".join(map(repr, filter(partial(is_not, None), (gamma,))))
        return interpolateColor(content=f"{self.content}.gamma({arguments})")

