mix
Blends two colors channel by channel.
t is how far to go from a to b: 0.0 gives a, 1.0 gives b, 0.5 the midpoint. It
is clamped to 0.0..=1.0 (a NaN counts as 0.0), and each channel is rounded to the nearest
integer. The blend happens in sRGB, without gamma correction, like CSS color-mix(in srgb).
Import
Section titled “Import”Cargo feature color (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
a | Rgb | The color at t = 0. |
b | Rgb | The color at t = 1. |
t | f64 | How far from a towards b, 0.0..=1.0. |
Returns
Section titled “Returns”Rgb — The blended color.
