Reference · Facts, line drawings and positions
mixfunction
Mix two #rrggbb colours: t is how much of b (0 to 1).
Import it
import { mix } from "@johnmorrisdotca/wakusei-planets";
Definition
function mix(a: string, b: string, t: number): string
Parameters
| Name | Type | Description |
|---|---|---|
a | string | The first colour. |
b | string | The second colour. |
t | number | How much of |
Returns
string
The mixed colour as #rrggbb.
Examples
import { mix } from "@johnmorrisdotca/wakusei-planets";
console.log(mix("#000000", "#ffffff", 0.5));#808080What it prints (run when this page was built)