Function: mix()
ts
function mix(
a,
b,
weight?): string;Mixes two hex colors together. weight (0–1) controls how much of b is blended in; default is 0.5 (equal mix).
Parameters
| Parameter | Type | Default value |
|---|---|---|
a | string | undefined |
b | string | undefined |
weight | number | 0.5 |
Returns
string
Example
ts
mix('#ff0000', '#0000ff', 0.5) // => '#7f007f'Since
1.0.0