Function: setLightness()
ts
function setLightness(color, lightness): Color;Defined in: setLightness.ts:15
Set the lightness value for a color to a specific value.
Parameters
| Parameter | Type | Description |
|---|---|---|
color | Color | the color to set the value for |
lightness | string | number | a number or string representing lightness. Numbers >= 1 are treated as a percentage (0–100). Numbers < 1 are treated as a ratio (0–1). Percentage strings are also accepted (e.g. "50%"). |
Returns
a new color with the new lightness value