Struct Rgb888

Source
pub struct Rgb888(/* private fields */);
Expand description

Rgb888 color.

Use the methods provided by the RgbColor trait to access individual color channels and predefined color constants.

See the module-level documentation for more information about conversion between this type and raw data.

Implementations§

Source§

impl Rgb888
where Self: RgbColor,

Source

pub const fn new(r: u8, g: u8, b: u8) -> Self

Creates a new Rgb888 color. Too large channel values will be limited by setting the unused most significant bits to zero.

Trait Implementations§

Source§

impl Clone for Rgb888

Source§

fn clone(&self) -> Rgb888

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Rgb888

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Rgb888

Source§

fn default() -> Rgb888

Returns the “default value” for a type. Read more
Source§

impl Format for Rgb888

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl From<Bgr555> for Rgb888

Source§

fn from(other: Bgr555) -> Self

Converts to this type from the input type.
Source§

impl From<Bgr565> for Rgb888

Source§

fn from(other: Bgr565) -> Self

Converts to this type from the input type.
Source§

impl From<Bgr666> for Rgb888

Source§

fn from(other: Bgr666) -> Self

Converts to this type from the input type.
Source§

impl From<Bgr888> for Rgb888

Source§

fn from(other: Bgr888) -> Self

Converts to this type from the input type.
Source§

impl From<BinaryColor> for Rgb888

Source§

fn from(color: BinaryColor) -> Self

Converts to this type from the input type.
Source§

impl From<Gray2> for Rgb888

Source§

fn from(other: Gray2) -> Self

Converts to this type from the input type.
Source§

impl From<Gray4> for Rgb888

Source§

fn from(other: Gray4) -> Self

Converts to this type from the input type.
Source§

impl From<Gray8> for Rgb888

Source§

fn from(other: Gray8) -> Self

Converts to this type from the input type.
Source§

impl From<RawU24> for Rgb888

Source§

fn from(data: RawU24) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb555> for Rgb888

Source§

fn from(other: Rgb555) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb565> for Rgb888

Source§

fn from(other: Rgb565) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb666> for Rgb888

Source§

fn from(other: Rgb666) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Bgr555

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Bgr565

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Bgr666

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Bgr888

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for BinaryColor

Source§

fn from(color: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Gray2

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Gray4

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Gray8

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for RawU24

Source§

fn from(color: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Rgb555

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Rgb565

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl From<Rgb888> for Rgb666

Source§

fn from(other: Rgb888) -> Self

Converts to this type from the input type.
Source§

impl Hash for Rgb888

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Rgb888

Source§

fn cmp(&self, other: &Rgb888) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Rgb888

Source§

fn eq(&self, other: &Rgb888) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Rgb888

Source§

fn partial_cmp(&self, other: &Rgb888) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PixelColor for Rgb888

Source§

type Raw = RawU24

Raw data type. Read more
Source§

impl RgbColor for Rgb888

Source§

const MAX_R: u8 = 255u8

The maximum value in the red channel.
Source§

const MAX_G: u8 = 255u8

The maximum value in the green channel.
Source§

const MAX_B: u8 = 255u8

The maximum value in the blue channel.
Source§

const BLACK: Self

Black color (R: 0%, G: 0%, B: 0%)
Source§

const RED: Self

Red color (R: 100%, G: 0%, B: 0%)
Source§

const GREEN: Self

Green color (R: 0%, G: 100%, B: 0%)
Source§

const BLUE: Self

Blue color (R: 0%, G: 0%, B: 100%)
Source§

const YELLOW: Self

Yellow color (R: 100%, G: 100%, B: 0%)
Source§

const MAGENTA: Self

Magenta color (R: 100%, G: 0%, B: 100%)
Source§

const CYAN: Self

Cyan color (R: 0%, G: 100%, B: 100%)
Source§

const WHITE: Self

White color (R: 100%, G: 100%, B: 100%)
Source§

fn r(&self) -> u8

Returns the red channel value.
Source§

fn g(&self) -> u8

Returns the green channel value.
Source§

fn b(&self) -> u8

Returns the blue channel value.
Source§

impl WebColors for Rgb888

Named web colors.

Source§

const CSS_ALICE_BLUE: Self

Alice Blue

Source§

const CSS_ANTIQUE_WHITE: Self

Antique White

Source§

const CSS_AQUA: Self

Aqua

Source§

const CSS_AQUAMARINE: Self

Aquamarine

Source§

const CSS_AZURE: Self

Azure

Source§

const CSS_BEIGE: Self

Beige

Source§

const CSS_BISQUE: Self

Bisque

Source§

const CSS_BLACK: Self

Black

Source§

const CSS_BLANCHED_ALMOND: Self

Blanched Almond

Source§

const CSS_BLUE: Self

Blue

Source§

const CSS_BLUE_VIOLET: Self

Blue Violet

Source§

const CSS_BROWN: Self

Brown

Source§

const CSS_BURLY_WOOD: Self

Burly Wood

Source§

const CSS_CADET_BLUE: Self

Cadet Blue

Source§

const CSS_CHARTREUSE: Self

Chartreuse

Source§

const CSS_CHOCOLATE: Self

Chocolate

Source§

const CSS_CORAL: Self

Coral

Source§

const CSS_CORNFLOWER_BLUE: Self

Cornflower Blue

Source§

const CSS_CORNSILK: Self

Cornsilk

Source§

const CSS_CRIMSON: Self

Crimson

Source§

const CSS_CYAN: Self

Cyan

Source§

const CSS_DARK_BLUE: Self

Dark Blue

Source§

const CSS_DARK_CYAN: Self

Dark Cyan

Source§

const CSS_DARK_GOLDENROD: Self

Dark Goldenrod

Source§

const CSS_DARK_GRAY: Self

Dark Gray

Source§

const CSS_DARK_GREEN: Self

Dark Green

Source§

const CSS_DARK_KHAKI: Self

Dark Khaki

Source§

const CSS_DARK_MAGENTA: Self

Dark Magenta

Source§

const CSS_DARK_OLIVE_GREEN: Self

Dark Olive Green

Source§

const CSS_DARK_ORANGE: Self

Dark Orange

Source§

const CSS_DARK_ORCHID: Self

Dark Orchid

Source§

const CSS_DARK_RED: Self

Dark Red

Source§

const CSS_DARK_SALMON: Self

Dark Salmon

Source§

const CSS_DARK_SEA_GREEN: Self

Dark Sea Green

Source§

const CSS_DARK_SLATE_BLUE: Self

Dark Slate Blue

Source§

const CSS_DARK_SLATE_GRAY: Self

Dark Slate Gray

Source§

const CSS_DARK_TURQUOISE: Self

Dark Turquoise

Source§

const CSS_DARK_VIOLET: Self

Dark Violet

Source§

const CSS_DEEP_PINK: Self

Deep Pink

Source§

const CSS_DEEP_SKY_BLUE: Self

Deep Sky Blue

Source§

const CSS_DIM_GRAY: Self

Dim Gray

Source§

const CSS_DODGER_BLUE: Self

Dodger Blue

Source§

const CSS_FIRE_BRICK: Self

Fire Brick

Source§

const CSS_FLORAL_WHITE: Self

Floral White

Source§

const CSS_FOREST_GREEN: Self

Forest Green

Source§

const CSS_FUCHSIA: Self

Fuchsia

Source§

const CSS_GAINSBORO: Self

Gainsboro

Source§

const CSS_GHOST_WHITE: Self

Ghost White

Source§

const CSS_GOLD: Self

Gold

Source§

const CSS_GOLDENROD: Self

Goldenrod

Source§

const CSS_GRAY: Self

Gray

Source§

const CSS_GREEN: Self

Green

Source§

const CSS_GREEN_YELLOW: Self

Green Yellow

Source§

const CSS_HONEYDEW: Self

Honeydew

Source§

const CSS_HOT_PINK: Self

Hot Pink

Source§

const CSS_INDIAN_RED: Self

Indian Red

Source§

const CSS_INDIGO: Self

Indigo

Source§

const CSS_IVORY: Self

Ivory

Source§

const CSS_KHAKI: Self

Khaki

Source§

const CSS_LAVENDER: Self

Lavender

Source§

const CSS_LAVENDER_BLUSH: Self

Lavender Blush

Source§

const CSS_LAWN_GREEN: Self

Lawn Green

Source§

const CSS_LEMON_CHIFFON: Self

Lemon Chiffon

Source§

const CSS_LIGHT_BLUE: Self

Light Blue

Source§

const CSS_LIGHT_CORAL: Self

Light Coral

Source§

const CSS_LIGHT_CYAN: Self

Light Cyan

Source§

const CSS_LIGHT_GOLDENROD_YELLOW: Self

Light Goldenrod Yellow

Source§

const CSS_LIGHT_GRAY: Self

Light Gray

Source§

const CSS_LIGHT_GREEN: Self

Light Green

Source§

const CSS_LIGHT_PINK: Self

Light Pink

Source§

const CSS_LIGHT_SALMON: Self

Light Salmon

Source§

const CSS_LIGHT_SEA_GREEN: Self

Light Sea Green

Source§

const CSS_LIGHT_SKY_BLUE: Self

Light Sky Blue

Source§

const CSS_LIGHT_SLATE_GRAY: Self

Light Slate Gray

Source§

const CSS_LIGHT_STEEL_BLUE: Self

Light Steel Blue

Source§

const CSS_LIGHT_YELLOW: Self

Light Yellow

Source§

const CSS_LIME: Self

Lime

Source§

const CSS_LIME_GREEN: Self

Lime Green

Source§

const CSS_LINEN: Self

Linen

Source§

const CSS_MAGENTA: Self

Magenta

Source§

const CSS_MAROON: Self

Maroon

Source§

const CSS_MEDIUM_AQUAMARINE: Self

Medium Aquamarine

Source§

const CSS_MEDIUM_BLUE: Self

Medium Blue

Source§

const CSS_MEDIUM_ORCHID: Self

Medium Orchid

Source§

const CSS_MEDIUM_PURPLE: Self

Medium Purple

Source§

const CSS_MEDIUM_SEA_GREEN: Self

Medium Sea Green

Source§

const CSS_MEDIUM_SLATE_BLUE: Self

Medium Slate Blue

Source§

const CSS_MEDIUM_SPRING_GREEN: Self

Medium Spring Green

Source§

const CSS_MEDIUM_TURQUOISE: Self

Medium Turquoise

Source§

const CSS_MEDIUM_VIOLET_RED: Self

Medium Violet Red

Source§

const CSS_MIDNIGHT_BLUE: Self

Midnight Blue

Source§

const CSS_MINT_CREAM: Self

Mint Cream

Source§

const CSS_MISTY_ROSE: Self

Misty Rose

Source§

const CSS_MOCCASIN: Self

Moccasin

Source§

const CSS_NAVAJO_WHITE: Self

Navajo White

Source§

const CSS_NAVY: Self

Navy

Source§

const CSS_OLD_LACE: Self

Old Lace

Source§

const CSS_OLIVE: Self

Olive

Source§

const CSS_OLIVE_DRAB: Self

Olive Drab

Source§

const CSS_ORANGE: Self

Orange

Source§

const CSS_ORANGE_RED: Self

Orange Red

Source§

const CSS_ORCHID: Self

Orchid

Source§

const CSS_PALE_GOLDENROD: Self

Pale Goldenrod

Source§

const CSS_PALE_GREEN: Self

Pale Green

Source§

const CSS_PALE_TURQUOISE: Self

Pale Turquoise

Source§

const CSS_PALE_VIOLET_RED: Self

Pale Violet Red

Source§

const CSS_PAPAYA_WHIP: Self

Papaya Whip

Source§

const CSS_PEACH_PUFF: Self

Peach Puff

Source§

const CSS_PERU: Self

Peru

Source§

const CSS_PINK: Self

Pink

Source§

const CSS_PLUM: Self

Plum

Source§

const CSS_POWDER_BLUE: Self

Powder Blue

Source§

const CSS_PURPLE: Self

Purple

Source§

const CSS_REBECCAPURPLE: Self

Rebeccapurple

Source§

const CSS_RED: Self

Red

Source§

const CSS_ROSY_BROWN: Self

Rosy Brown

Source§

const CSS_ROYAL_BLUE: Self

Royal Blue

Source§

const CSS_SADDLE_BROWN: Self

Saddle Brown

Source§

const CSS_SALMON: Self

Salmon

Source§

const CSS_SANDY_BROWN: Self

Sandy Brown

Source§

const CSS_SEA_GREEN: Self

Sea Green

Source§

const CSS_SEASHELL: Self

Seashell

Source§

const CSS_SIENNA: Self

Sienna

Source§

const CSS_SILVER: Self

Silver

Source§

const CSS_SKY_BLUE: Self

Sky Blue

Source§

const CSS_SLATE_BLUE: Self

Slate Blue

Source§

const CSS_SLATE_GRAY: Self

Slate Gray

Source§

const CSS_SNOW: Self

Snow

Source§

const CSS_SPRING_GREEN: Self

Spring Green

Source§

const CSS_STEEL_BLUE: Self

Steel Blue

Source§

const CSS_TAN: Self

Tan

Source§

const CSS_TEAL: Self

Teal

Source§

const CSS_THISTLE: Self

Thistle

Source§

const CSS_TOMATO: Self

Tomato

Source§

const CSS_TURQUOISE: Self

Turquoise

Source§

const CSS_VIOLET: Self

Violet

Source§

const CSS_WHEAT: Self

Wheat

Source§

const CSS_WHITE: Self

White

Source§

const CSS_WHITE_SMOKE: Self

White Smoke

Source§

const CSS_YELLOW: Self

Yellow

Source§

const CSS_YELLOW_GREEN: Self

Yellow Green

Source§

impl Copy for Rgb888

Source§

impl Eq for Rgb888

Source§

impl StructuralPartialEq for Rgb888

Auto Trait Implementations§

§

impl Freeze for Rgb888

§

impl RefUnwindSafe for Rgb888

§

impl Send for Rgb888

§

impl Sync for Rgb888

§

impl Unpin for Rgb888

§

impl UnwindSafe for Rgb888

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<C> IntoStorage for C
where C: PixelColor, <C as PixelColor>::Raw: From<C>,

Source§

type Storage = <<C as PixelColor>::Raw as RawData>::Storage

The underlying storage type for the pixel color
Source§

fn into_storage(self) -> <C as IntoStorage>::Storage

Convert the PixelColor into its raw storage form
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<C> ToBytes for C
where C: PixelColor + Into<<C as PixelColor>::Raw>,

Source§

type Bytes = <<C as PixelColor>::Raw as ToBytes>::Bytes

Return type of methods in this trait.
Source§

fn to_le_bytes(self) -> <C as ToBytes>::Bytes

Converts a color into a byte array with little endian byte order.
Source§

fn to_be_bytes(self) -> <C as ToBytes>::Bytes

Converts a color into a byte array with big endian byte order.
Source§

fn to_ne_bytes(self) -> <C as ToBytes>::Bytes

Converts a color into a byte array with native byte order.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,