Color

Trait Color 

Source
pub trait Color {
    type ChannelType: Unsigned + Into<usize>;

    const CHANNELS: u8;
}
Expand description

Utility trait that retrieves metadata about all smart_leds_trait color types.

Required Associated Constants§

Source

const CHANNELS: u8

The maximum channel number this color supports.

  • For RGB (or any permutation thereof), this is 3.
  • For RGBW, this is 4.
  • For RGBCCT, this is 5.
  • For CCT, this is 2.

Note that this channel count is used by users of ColorOrder to limit the channel number that’s passed into ColorOrder::get_channel_data.

Required Associated Types§

Source

type ChannelType: Unsigned + Into<usize>

Type of a single channel of this color. Usually u8, but u16 is also used for some LEDs.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> Color for RGB<T>
where T: Unsigned + Into<usize>,

Source§

impl<T> Color for CctWhite<T>
where T: Unsigned + Into<usize>,

Source§

impl<T> Color for White<T>
where T: Unsigned + Into<usize>,

Source§

impl<T> Color for RGBCCT<T>
where T: Unsigned + Into<usize>,

Source§

impl<T> Color for RGBW<T>
where T: Unsigned + Into<usize>,

Implementors§