pub trait Blend<T> {
    fn blend(self, other: Self, factor: T) -> Self;
}
Expand description

A trait to blend between two values by some factor.

Required Methods

Blend between two values.

// Blend entirely in integer math.
assert_eq!(100.blend(200, 0), 100);
assert_eq!(100.blend(200, 128), 150);
assert_eq!(100.blend(200, 255), 200);
// Blend with a floating point factor.
assert_eq!(100.blend(200, 0.0), 100);
assert_eq!(100.blend(200, 0.5), 150);
assert_eq!(100.blend(200, 1.0), 200);

Implementations on Foreign Types

Implementors