Skip to main content

ColorFunction

Trait ColorFunction 

Source
pub trait ColorFunction {
    type Color;

    // Required methods
    fn size(&self) -> usize;
    fn get(&self, index: usize) -> Self::Color;
}
Expand description

Trait for color lookup functions used by span_gradient.

Provides indexed access to a color palette of known size.

Required Associated Types§

Required Methods§

Source

fn size(&self) -> usize

Source

fn get(&self, index: usize) -> Self::Color

Implementors§