Struct embedded_graphics::pixelcolor::Bgr565

source ·
pub struct Bgr565(/* private fields */);
Expand description

Bgr565 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 Bgr565

source

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

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

Trait Implementations§

source§

impl Clone for Bgr565

source§

fn clone(&self) -> Bgr565

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 ColorMapping for Bgr565

source§

fn char_to_color(c: char) -> Self

Converts a char into a color of type C.
source§

fn color_to_char(color: Self) -> char

Converts a color of type C into a char.
source§

const NONE_COLOR: Rgb888 = _

Color used to display None values when EG_FANCY_PANIC is enabled. Read more
source§

impl Debug for Bgr565

source§

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

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

impl Default for Bgr565

source§

fn default() -> Bgr565

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

impl From<Bgr555> for Bgr565

source§

fn from(other: Bgr555) -> Bgr565

Converts to this type from the input type.
source§

impl From<Bgr565> for Bgr555

source§

fn from(other: Bgr565) -> Bgr555

Converts to this type from the input type.
source§

impl From<Bgr565> for Bgr888

source§

fn from(other: Bgr565) -> Bgr888

Converts to this type from the input type.
source§

impl From<Bgr565> for BinaryColor

source§

fn from(color: Bgr565) -> BinaryColor

Converts to this type from the input type.
source§

impl From<Bgr565> for Gray2

source§

fn from(other: Bgr565) -> Gray2

Converts to this type from the input type.
source§

impl From<Bgr565> for Gray4

source§

fn from(other: Bgr565) -> Gray4

Converts to this type from the input type.
source§

impl From<Bgr565> for Gray8

source§

fn from(other: Bgr565) -> Gray8

Converts to this type from the input type.
source§

impl From<Bgr565> for RawU16

source§

fn from(color: Bgr565) -> RawU16

Converts to this type from the input type.
source§

impl From<Bgr565> for Rgb555

source§

fn from(other: Bgr565) -> Rgb555

Converts to this type from the input type.
source§

impl From<Bgr565> for Rgb565

source§

fn from(other: Bgr565) -> Rgb565

Converts to this type from the input type.
source§

impl From<Bgr565> for Rgb888

source§

fn from(other: Bgr565) -> Rgb888

Converts to this type from the input type.
source§

impl From<Bgr888> for Bgr565

source§

fn from(other: Bgr888) -> Bgr565

Converts to this type from the input type.
source§

impl From<BinaryColor> for Bgr565

source§

fn from(color: BinaryColor) -> Bgr565

Converts to this type from the input type.
source§

impl From<Gray2> for Bgr565

source§

fn from(other: Gray2) -> Bgr565

Converts to this type from the input type.
source§

impl From<Gray4> for Bgr565

source§

fn from(other: Gray4) -> Bgr565

Converts to this type from the input type.
source§

impl From<Gray8> for Bgr565

source§

fn from(other: Gray8) -> Bgr565

Converts to this type from the input type.
source§

impl From<RawU16> for Bgr565

source§

fn from(data: RawU16) -> Bgr565

Converts to this type from the input type.
source§

impl From<Rgb555> for Bgr565

source§

fn from(other: Rgb555) -> Bgr565

Converts to this type from the input type.
source§

impl From<Rgb565> for Bgr565

source§

fn from(other: Rgb565) -> Bgr565

Converts to this type from the input type.
source§

impl From<Rgb888> for Bgr565

source§

fn from(other: Rgb888) -> Bgr565

Converts to this type from the input type.
source§

impl Hash for Bgr565

source§

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

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 Bgr565

source§

fn cmp(&self, other: &Bgr565) -> 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 + PartialOrd,

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

impl PartialEq for Bgr565

source§

fn eq(&self, other: &Bgr565) -> 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 Bgr565

source§

fn partial_cmp(&self, other: &Bgr565) -> 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 Bgr565

§

type Raw = RawU16

Raw data type. Read more
source§

impl RgbColor for Bgr565

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§

const MAX_R: u8 = 31u8

The maximum value in the red channel.
source§

const MAX_G: u8 = 63u8

The maximum value in the green channel.
source§

const MAX_B: u8 = 31u8

The maximum value in the blue channel.
source§

const BLACK: Bgr565 = _

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

const RED: Bgr565 = _

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

const GREEN: Bgr565 = _

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

const BLUE: Bgr565 = _

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

const YELLOW: Bgr565 = _

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

const MAGENTA: Bgr565 = _

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

const CYAN: Bgr565 = _

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

const WHITE: Bgr565 = _

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

impl WebColors for Bgr565

Named web colors.

source§

const CSS_ALICE_BLUE: Bgr565 = _

Alice Blue

source§

const CSS_ANTIQUE_WHITE: Bgr565 = _

Antique White

source§

const CSS_AQUA: Bgr565 = _

Aqua

source§

const CSS_AQUAMARINE: Bgr565 = _

Aquamarine

source§

const CSS_AZURE: Bgr565 = _

Azure

source§

const CSS_BEIGE: Bgr565 = _

Beige

source§

const CSS_BISQUE: Bgr565 = _

Bisque

source§

const CSS_BLACK: Bgr565 = _

Black

source§

const CSS_BLANCHED_ALMOND: Bgr565 = _

Blanched Almond

source§

const CSS_BLUE: Bgr565 = _

Blue

source§

const CSS_BLUE_VIOLET: Bgr565 = _

Blue Violet

source§

const CSS_BROWN: Bgr565 = _

Brown

source§

const CSS_BURLY_WOOD: Bgr565 = _

Burly Wood

source§

const CSS_CADET_BLUE: Bgr565 = _

Cadet Blue

source§

const CSS_CHARTREUSE: Bgr565 = _

Chartreuse

source§

const CSS_CHOCOLATE: Bgr565 = _

Chocolate

source§

const CSS_CORAL: Bgr565 = _

Coral

source§

const CSS_CORNFLOWER_BLUE: Bgr565 = _

Cornflower Blue

source§

const CSS_CORNSILK: Bgr565 = _

Cornsilk

source§

const CSS_CRIMSON: Bgr565 = _

Crimson

source§

const CSS_CYAN: Bgr565 = _

Cyan

source§

const CSS_DARK_BLUE: Bgr565 = _

Dark Blue

source§

const CSS_DARK_CYAN: Bgr565 = _

Dark Cyan

source§

const CSS_DARK_GOLDENROD: Bgr565 = _

Dark Goldenrod

source§

const CSS_DARK_GRAY: Bgr565 = _

Dark Gray

source§

const CSS_DARK_GREEN: Bgr565 = _

Dark Green

source§

const CSS_DARK_KHAKI: Bgr565 = _

Dark Khaki

source§

const CSS_DARK_MAGENTA: Bgr565 = _

Dark Magenta

source§

const CSS_DARK_OLIVE_GREEN: Bgr565 = _

Dark Olive Green

source§

const CSS_DARK_ORANGE: Bgr565 = _

Dark Orange

source§

const CSS_DARK_ORCHID: Bgr565 = _

Dark Orchid

source§

const CSS_DARK_RED: Bgr565 = _

Dark Red

source§

const CSS_DARK_SALMON: Bgr565 = _

Dark Salmon

source§

const CSS_DARK_SEA_GREEN: Bgr565 = _

Dark Sea Green

source§

const CSS_DARK_SLATE_BLUE: Bgr565 = _

Dark Slate Blue

source§

const CSS_DARK_SLATE_GRAY: Bgr565 = _

Dark Slate Gray

source§

const CSS_DARK_TURQUOISE: Bgr565 = _

Dark Turquoise

source§

const CSS_DARK_VIOLET: Bgr565 = _

Dark Violet

source§

const CSS_DEEP_PINK: Bgr565 = _

Deep Pink

source§

const CSS_DEEP_SKY_BLUE: Bgr565 = _

Deep Sky Blue

source§

const CSS_DIM_GRAY: Bgr565 = _

Dim Gray

source§

const CSS_DODGER_BLUE: Bgr565 = _

Dodger Blue

source§

const CSS_FIRE_BRICK: Bgr565 = _

Fire Brick

source§

const CSS_FLORAL_WHITE: Bgr565 = _

Floral White

source§

const CSS_FOREST_GREEN: Bgr565 = _

Forest Green

source§

const CSS_FUCHSIA: Bgr565 = _

Fuchsia

source§

const CSS_GAINSBORO: Bgr565 = _

Gainsboro

source§

const CSS_GHOST_WHITE: Bgr565 = _

Ghost White

source§

const CSS_GOLD: Bgr565 = _

Gold

source§

const CSS_GOLDENROD: Bgr565 = _

Goldenrod

source§

const CSS_GRAY: Bgr565 = _

Gray

source§

const CSS_GREEN: Bgr565 = _

Green

source§

const CSS_GREEN_YELLOW: Bgr565 = _

Green Yellow

source§

const CSS_HONEYDEW: Bgr565 = _

Honeydew

source§

const CSS_HOT_PINK: Bgr565 = _

Hot Pink

source§

const CSS_INDIAN_RED: Bgr565 = _

Indian Red

source§

const CSS_INDIGO: Bgr565 = _

Indigo

source§

const CSS_IVORY: Bgr565 = _

Ivory

source§

const CSS_KHAKI: Bgr565 = _

Khaki

source§

const CSS_LAVENDER: Bgr565 = _

Lavender

source§

const CSS_LAVENDER_BLUSH: Bgr565 = _

Lavender Blush

source§

const CSS_LAWN_GREEN: Bgr565 = _

Lawn Green

source§

const CSS_LEMON_CHIFFON: Bgr565 = _

Lemon Chiffon

source§

const CSS_LIGHT_BLUE: Bgr565 = _

Light Blue

source§

const CSS_LIGHT_CORAL: Bgr565 = _

Light Coral

source§

const CSS_LIGHT_CYAN: Bgr565 = _

Light Cyan

source§

const CSS_LIGHT_GOLDENROD_YELLOW: Bgr565 = _

Light Goldenrod Yellow

source§

const CSS_LIGHT_GRAY: Bgr565 = _

Light Gray

source§

const CSS_LIGHT_GREEN: Bgr565 = _

Light Green

source§

const CSS_LIGHT_PINK: Bgr565 = _

Light Pink

source§

const CSS_LIGHT_SALMON: Bgr565 = _

Light Salmon

source§

const CSS_LIGHT_SEA_GREEN: Bgr565 = _

Light Sea Green

source§

const CSS_LIGHT_SKY_BLUE: Bgr565 = _

Light Sky Blue

source§

const CSS_LIGHT_SLATE_GRAY: Bgr565 = _

Light Slate Gray

source§

const CSS_LIGHT_STEEL_BLUE: Bgr565 = _

Light Steel Blue

source§

const CSS_LIGHT_YELLOW: Bgr565 = _

Light Yellow

source§

const CSS_LIME: Bgr565 = _

Lime

source§

const CSS_LIME_GREEN: Bgr565 = _

Lime Green

source§

const CSS_LINEN: Bgr565 = _

Linen

source§

const CSS_MAGENTA: Bgr565 = _

Magenta

source§

const CSS_MAROON: Bgr565 = _

Maroon

source§

const CSS_MEDIUM_AQUAMARINE: Bgr565 = _

Medium Aquamarine

source§

const CSS_MEDIUM_BLUE: Bgr565 = _

Medium Blue

source§

const CSS_MEDIUM_ORCHID: Bgr565 = _

Medium Orchid

source§

const CSS_MEDIUM_PURPLE: Bgr565 = _

Medium Purple

source§

const CSS_MEDIUM_SEA_GREEN: Bgr565 = _

Medium Sea Green

source§

const CSS_MEDIUM_SLATE_BLUE: Bgr565 = _

Medium Slate Blue

source§

const CSS_MEDIUM_SPRING_GREEN: Bgr565 = _

Medium Spring Green

source§

const CSS_MEDIUM_TURQUOISE: Bgr565 = _

Medium Turquoise

source§

const CSS_MEDIUM_VIOLET_RED: Bgr565 = _

Medium Violet Red

source§

const CSS_MIDNIGHT_BLUE: Bgr565 = _

Midnight Blue

source§

const CSS_MINT_CREAM: Bgr565 = _

Mint Cream

source§

const CSS_MISTY_ROSE: Bgr565 = _

Misty Rose

source§

const CSS_MOCCASIN: Bgr565 = _

Moccasin

source§

const CSS_NAVAJO_WHITE: Bgr565 = _

Navajo White

source§

const CSS_NAVY: Bgr565 = _

Navy

source§

const CSS_OLD_LACE: Bgr565 = _

Old Lace

source§

const CSS_OLIVE: Bgr565 = _

Olive

source§

const CSS_OLIVE_DRAB: Bgr565 = _

Olive Drab

source§

const CSS_ORANGE: Bgr565 = _

Orange

source§

const CSS_ORANGE_RED: Bgr565 = _

Orange Red

source§

const CSS_ORCHID: Bgr565 = _

Orchid

source§

const CSS_PALE_GOLDENROD: Bgr565 = _

Pale Goldenrod

source§

const CSS_PALE_GREEN: Bgr565 = _

Pale Green

source§

const CSS_PALE_TURQUOISE: Bgr565 = _

Pale Turquoise

source§

const CSS_PALE_VIOLET_RED: Bgr565 = _

Pale Violet Red

source§

const CSS_PAPAYA_WHIP: Bgr565 = _

Papaya Whip

source§

const CSS_PEACH_PUFF: Bgr565 = _

Peach Puff

source§

const CSS_PERU: Bgr565 = _

Peru

source§

const CSS_PINK: Bgr565 = _

Pink

source§

const CSS_PLUM: Bgr565 = _

Plum

source§

const CSS_POWDER_BLUE: Bgr565 = _

Powder Blue

source§

const CSS_PURPLE: Bgr565 = _

Purple

source§

const CSS_REBECCAPURPLE: Bgr565 = _

Rebeccapurple

source§

const CSS_RED: Bgr565 = _

Red

source§

const CSS_ROSY_BROWN: Bgr565 = _

Rosy Brown

source§

const CSS_ROYAL_BLUE: Bgr565 = _

Royal Blue

source§

const CSS_SADDLE_BROWN: Bgr565 = _

Saddle Brown

source§

const CSS_SALMON: Bgr565 = _

Salmon

source§

const CSS_SANDY_BROWN: Bgr565 = _

Sandy Brown

source§

const CSS_SEA_GREEN: Bgr565 = _

Sea Green

source§

const CSS_SEASHELL: Bgr565 = _

Seashell

source§

const CSS_SIENNA: Bgr565 = _

Sienna

source§

const CSS_SILVER: Bgr565 = _

Silver

source§

const CSS_SKY_BLUE: Bgr565 = _

Sky Blue

source§

const CSS_SLATE_BLUE: Bgr565 = _

Slate Blue

source§

const CSS_SLATE_GRAY: Bgr565 = _

Slate Gray

source§

const CSS_SNOW: Bgr565 = _

Snow

source§

const CSS_SPRING_GREEN: Bgr565 = _

Spring Green

source§

const CSS_STEEL_BLUE: Bgr565 = _

Steel Blue

source§

const CSS_TAN: Bgr565 = _

Tan

source§

const CSS_TEAL: Bgr565 = _

Teal

source§

const CSS_THISTLE: Bgr565 = _

Thistle

source§

const CSS_TOMATO: Bgr565 = _

Tomato

source§

const CSS_TURQUOISE: Bgr565 = _

Turquoise

source§

const CSS_VIOLET: Bgr565 = _

Violet

source§

const CSS_WHEAT: Bgr565 = _

Wheat

source§

const CSS_WHITE: Bgr565 = _

White

source§

const CSS_WHITE_SMOKE: Bgr565 = _

White Smoke

source§

const CSS_YELLOW: Bgr565 = _

Yellow

source§

const CSS_YELLOW_GREEN: Bgr565 = _

Yellow Green

source§

impl Copy for Bgr565

source§

impl Eq for Bgr565

source§

impl StructuralPartialEq for Bgr565

Auto Trait Implementations§

§

impl Freeze for Bgr565

§

impl RefUnwindSafe for Bgr565

§

impl Send for Bgr565

§

impl Sync for Bgr565

§

impl Unpin for Bgr565

§

impl UnwindSafe for Bgr565

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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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>,

§

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> 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<C> ToBytes for C
where C: PixelColor + Into<<C as PixelColor>::Raw>,

§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.