Function: setAlpha()
ts
function setAlpha(color, alpha): Color;Defined in: setAlpha.ts:15
Set the alpha value for a color to a specific value.
Parameters
| Parameter | Type | Description |
|---|---|---|
color | Color | the color to set the value for |
alpha | string | number | a number or string representing alpha. 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 alpha value