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
| Parameter | Type | Description |
|---|---|---|
color | Color | The color to set the value for. |
saturation | string | number | A number between 0 and 100, or a percentage string (e.g. "50%"). |
Returns
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.