def generate(
        self,
        hue: Optional[HueType] = None,
        luminosity: Optional[str] = None,
        color_format: ColorFormat = "hex",
    ) -> str:
        """Generate and format a color.

        Whenever :meth:`color() <faker.providers.color.Provider.color>` is
        called, the arguments used are simply passed into this method, and this
        method handles the rest.
        """
        # Generate HSV color tuple from picked hue and luminosity
        hsv = self.generate_hsv(hue=hue, luminosity=luminosity)

        # Return the HSB/V color in the desired string format
        return self.set_format(hsv, color_format)
Generate and format a color.

        Whenever :meth:`color() <faker.providers.color.Provider.color>` is
        called, the arguments used are simply passed into this method, and this
        method handles the rest.
        
faker/providers/color/color.py