Function: mix()
ts
function mix(
color1,
color2,
weight?): Color;Defined in: mix.ts:21
Mix two colors together by a specified weight
Implementation to the Sass mix function. Returns a color that’s a mixture of color1 and color2. Both the weight and the relative opacity of each color determines how much of each color is in the result.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
color1 | Color | undefined | The first color to be mixed |
color2 | Color | undefined | The second color to be mixed |
weight | number | 50 | The weight to mix the colors by (0-100). Default is 50 |
Returns
The mixed color
Throws
Invalid Color (color1) if the first color parameter is not a valid color
Throws
Invalid Color (color2) if the second color parameter is not a valid color