Struct sensehat::Colour[][src]

pub struct Colour {
    pub red: u8,
    pub green: u8,
    pub blue: u8,
}

24-bit RGB color pixel.

This is the fundamental representation for RGB colors.

Fields

Methods

impl PixelColor
[src]

BLACK: PixelColor = PixelColor{red: 0, green: 0, blue: 0,}

RED: PixelColor = PixelColor{red: 255, green: 0, blue: 0,}

BLUE: PixelColor = PixelColor{red: 0, green: 0, blue: 255,}

GREEN: PixelColor = PixelColor{red: 0, green: 255, blue: 0,}

WHITE: PixelColor = PixelColor{red: 255, green: 255, blue: 255,}

YELLOW: PixelColor = PixelColor{red: 255, green: 255, blue: 0,}

CYAN: PixelColor = PixelColor{red: 0, green: 255, blue: 255,}

MAGENTA: PixelColor = PixelColor{red: 255, green: 0, blue: 255,}

Create a new LED pixel color.

Create a new LED pixel color from a pair of RGB565-encoded bytes.

Encodes the current LED pixel color into a pair of RGB565-encoded bytes.

Sets the brightness of this colour.

The scale value should be between 0 and 1. Values outside this range are clamped.

Trait Implementations

impl Into<(u8, u8, u8)> for PixelColor
[src]

Performs the conversion.

impl Clone for PixelColor
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for PixelColor
[src]

Returns the "default value" for a type. Read more

impl Debug for PixelColor
[src]

Formats the value using the given formatter. Read more

impl Copy for PixelColor
[src]

impl Serialize for PixelColor
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for PixelColor
[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<PixelColor> for PixelColor
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl From<PixelColor> for Rgb565
[src]

Performs the conversion.

impl From<(u8, u8, u8)> for PixelColor
[src]

Performs the conversion.

impl<'a> From<&'a PixelColor> for Rgb565
[src]

Performs the conversion.

impl From<Rgb565> for PixelColor
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for PixelColor

impl Sync for PixelColor