Trait ColorMap

trait ColorMap

A color map

Associated Types

type Color

The color type on which the map operates on

Required Methods

fn index_of(self: &Self, color: &<Self as >::Color) -> usize

Returns the index of the closest match of color in the color map.

fn map_color(self: &Self, color: &mut <Self as >::Color)

Maps color to the closest color in the color map.

Provided Methods

fn lookup(self: &Self, index: usize) -> Option<<Self as >::Color>

Looks up color by index in the color map. If idx is out of range for the color map, or ColorMap doesn't implement lookup None is returned.

fn has_lookup(self: &Self) -> bool

Determine if this implementation of ColorMap overrides the default lookup.

Implementors