Skip to content

Function: setSaturation()

ts
function setSaturation(color, saturation): Color;

Defined in: setSaturation.ts:16

Set the saturation value for a color to a specific value.

Parameters

ParameterTypeDescription
colorColorThe color to set the value for.
saturationstring | numberA number between 0 and 100, or a percentage string (e.g. "50%").

Returns

Color

A new color with the given saturation.

Throws

Invalid Color if the color parameter is not a valid color

Throws

If the saturation value is out of range.