Repository: ManimCommunity/manim
File: manim/utils/color/core.py (Python)

Code before:
        ----------
        other : ManimColor
            The other ManimColor to be used for interpolation
        alpha : float
            A point on the line in rgba colorspace connecting the two colors i.e. the interpolation point

            0 corresponds to the current ManimColor and 1 corresponds to the other ManimColor

        Returns
        -------
        ManimColor
            The interpolated ManimColor
        """
        return self._construct_from_space(
            self._internal_space * (1 - alpha) + other._internal_space * alpha
        )

    def darker(self, factor: float = 0.2) -> Self:
        """Returns a new color that is darker than the current color, i.e.
        interpolated with black. The opacity is unchanged.

        Parameters
        ----------
        factor : float, optional
            The factor by which the color should be darker, by default 0.2,
            which results in a slightly darker color

        Returns
        -------
        ManimColor
            The darker ManimColor

        See Also
        --------
        :meth:`lighter`
        """
        alpha = self._internal_space[3]
        black = self.from_rgb((0.0, 0.0, 0.0))
        return self.interpolate(black, factor).opacity(alpha)

    def lighter(self, factor: float = 0.2) -> Self:
        """Returns a new color that is lighter than the current color, i.e.
        interpolated with white. The opacity is unchanged.

        Parameters
        ----------
        factor : float, optional
            The factor by which the color should be lighter, by default 0.2,
            which results in a slightly lighter color

        Returns

Review comment (suggestion):
Minor improvement, plus added indication that the value is a ratio.

```suggestion
            The factor (as a float ratio) by which the color should be darker. By default 0.2,
            which results in a slightly darker color.
```

Code after:
        ----------
        other : ManimColor
            The other ManimColor to be used for interpolation
        alpha : float
            A point on the line in rgba colorspace connecting the two colors i.e. the interpolation point

            0 corresponds to the current ManimColor and 1 corresponds to the other ManimColor

        Returns
        -------
        ManimColor
            The interpolated ManimColor
        """
        return self._construct_from_space(
            self._internal_space * (1 - alpha) + other._internal_space * alpha
        )

    def darker(self, blend: float = 0.2) -> Self:
        """Returns a new color that is darker than the current color, i.e.
        interpolated with black. The opacity is unchanged.

        Parameters
        ----------
        blend : float, optional
            The blend ratio for the interpolation, from 0 (the current color
            unchanged) to 1 (pure black). By default 0.2 which results in a
            slightly darker color

        Returns
        -------
        ManimColor
            The darker ManimColor

        See Also
        --------
        :meth:`lighter`
        """
        from manim.utils.color.manim_colors import BLACK

        alpha = self._internal_space[3]
        black = self._from_internal(BLACK._internal_value)
        return self.interpolate(black, blend).opacity(alpha)

    def lighter(self, blend: float = 0.2) -> Self:
        """Returns a new color that is lighter than the current color, i.e.
        interpolated with white. The opacity is unchanged.

        Parameters
        ----------
        blend : float, optional
            The blend ratio for the interpolation, from 0 (the current color