Function setSaturation

  • setSaturation is a function that takes in a color and a saturation value, and returns a new color with the given saturation.

    Returns

    A new color with the given saturation.

    Throws

    Invalid Color if the color parameter is not a valid color

    Throws

    If the color is invalid or the saturation value is invalid (not a number between 0 and 100 or not a string in the format of "%d%").

    Parameters

    • color: Color

      The color that needs to have its saturation set.

    • saturation: string | number

      The saturation value to set. Accepted input formats are either a number between 0 and 100, or a string representing a percentage (e.g. "50%").

    Returns Color

Generated using TypeDoc