Struct picto::color::Gradient[][src]

pub struct Gradient<C>(_)
where
    C: Mix + Clone
;
Expand description

A linear interpolation between colors.

It’s used to smoothly transition between a series of colors, that can be either evenly spaced or have customized positions. The gradient is continuous between the control points, but it’s possible to iterate over a number of evenly spaced points using the take method. Any point outside the domain of the gradient will have the same color as the closest control point.

Implementations

Create a gradient of evenly spaced colors with the domain [0.0, 1.0]. There must be at least one color.

Create a gradient of colors with custom spacing and domain. There must be at least one color and they are expected to be ordered by their position value.

Get a color from the gradient. The color of the closest control point will be returned if i is outside the domain.

Take n evenly spaced colors from the gradient, as an iterator.

Slice this gradient to limit its domain.

Get the limits of this gradient’s domain.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of self.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.