Struct embedded_graphics::pixelcolor::Rgb666

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

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

source

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

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

Trait Implementations§

source§

impl Clone for Rgb666

source§

fn clone(&self) -> Rgb666

Returns a copy of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Rgb666

source§

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

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

impl Default for Rgb666

source§

fn default() -> Rgb666

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

impl From<Bgr555> for Rgb666

source§

fn from(other: Bgr555) -> Rgb666

Converts to this type from the input type.
source§

impl From<Bgr565> for Rgb666

source§

fn from(other: Bgr565) -> Rgb666

Converts to this type from the input type.
source§

impl From<Bgr666> for Rgb666

source§

fn from(other: Bgr666) -> Rgb666

Converts to this type from the input type.
source§

impl From<Bgr888> for Rgb666

source§

fn from(other: Bgr888) -> Rgb666

Converts to this type from the input type.
source§

impl From<BinaryColor> for Rgb666

source§

fn from(color: BinaryColor) -> Rgb666

Converts to this type from the input type.
source§

impl From<Gray2> for Rgb666

source§

fn from(other: Gray2) -> Rgb666

Converts to this type from the input type.
source§

impl From<Gray4> for Rgb666

source§

fn from(other: Gray4) -> Rgb666

Converts to this type from the input type.
source§

impl From<Gray8> for Rgb666

source§

fn from(other: Gray8) -> Rgb666

Converts to this type from the input type.
source§

impl From<RawU24> for Rgb666

source§

fn from(data: RawU24) -> Rgb666

Converts to this type from the input type.
source§

impl From<Rgb555> for Rgb666

source§

fn from(other: Rgb555) -> Rgb666

Converts to this type from the input type.
source§

impl From<Rgb565> for Rgb666

source§

fn from(other: Rgb565) -> Rgb666

Converts to this type from the input type.
source§

impl From<Rgb666> for Bgr555

source§

fn from(other: Rgb666) -> Bgr555

Converts to this type from the input type.
source§

impl From<Rgb666> for Bgr565

source§

fn from(other: Rgb666) -> Bgr565

Converts to this type from the input type.
source§

impl From<Rgb666> for Bgr666

source§

fn from(other: Rgb666) -> Bgr666

Converts to this type from the input type.
source§

impl From<Rgb666> for Bgr888

source§

fn from(other: Rgb666) -> Bgr888

Converts to this type from the input type.
source§

impl From<Rgb666> for BinaryColor

source§

fn from(color: Rgb666) -> BinaryColor

Converts to this type from the input type.
source§

impl From<Rgb666> for Gray2

source§

fn from(other: Rgb666) -> Gray2

Converts to this type from the input type.
source§

impl From<Rgb666> for Gray4

source§

fn from(other: Rgb666) -> Gray4

Converts to this type from the input type.
source§

impl From<Rgb666> for Gray8

source§

fn from(other: Rgb666) -> Gray8

Converts to this type from the input type.
source§

impl From<Rgb666> for RawU24

source§

fn from(color: Rgb666) -> RawU24

Converts to this type from the input type.
source§

impl From<Rgb666> for Rgb555

source§

fn from(other: Rgb666) -> Rgb555

Converts to this type from the input type.
source§

impl From<Rgb666> for Rgb565

source§

fn from(other: Rgb666) -> Rgb565

Converts to this type from the input type.
source§

impl From<Rgb666> for Rgb888

source§

fn from(other: Rgb666) -> Rgb888

Converts to this type from the input type.
source§

impl From<Rgb888> for Rgb666

source§

fn from(other: Rgb888) -> Rgb666

Converts to this type from the input type.
source§

impl Hash for Rgb666

source§

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

Feeds this value into the given [Hasher]. Read more
1.3.0§

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 Rgb666

source§

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

This method returns an [Ordering] between self and other. Read more
1.21.0§

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

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

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

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

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 Rgb666

source§

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

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

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Rgb666

source§

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

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

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PixelColor for Rgb666

§

type Raw = RawU24

Raw data type. Read more
source§

impl RgbColor for Rgb666

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 = 63u8

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 = 63u8

The maximum value in the blue channel.
source§

const BLACK: Rgb666 = _

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

const RED: Rgb666 = _

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

const GREEN: Rgb666 = _

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

const BLUE: Rgb666 = _

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

const YELLOW: Rgb666 = _

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

const MAGENTA: Rgb666 = _

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

const CYAN: Rgb666 = _

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

const WHITE: Rgb666 = _

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

impl WebColors for Rgb666

Named web colors.

source§

const CSS_ALICE_BLUE: Rgb666 = _

Alice Blue

source§

const CSS_ANTIQUE_WHITE: Rgb666 = _

Antique White

source§

const CSS_AQUA: Rgb666 = _

Aqua

source§

const CSS_AQUAMARINE: Rgb666 = _

Aquamarine

source§

const CSS_AZURE: Rgb666 = _

Azure

source§

const CSS_BEIGE: Rgb666 = _

Beige

source§

const CSS_BISQUE: Rgb666 = _

Bisque

source§

const CSS_BLACK: Rgb666 = _

Black

source§

const CSS_BLANCHED_ALMOND: Rgb666 = _

Blanched Almond

source§

const CSS_BLUE: Rgb666 = _

Blue

source§

const CSS_BLUE_VIOLET: Rgb666 = _

Blue Violet

source§

const CSS_BROWN: Rgb666 = _

Brown

source§

const CSS_BURLY_WOOD: Rgb666 = _

Burly Wood

source§

const CSS_CADET_BLUE: Rgb666 = _

Cadet Blue

source§

const CSS_CHARTREUSE: Rgb666 = _

Chartreuse

source§

const CSS_CHOCOLATE: Rgb666 = _

Chocolate

source§

const CSS_CORAL: Rgb666 = _

Coral

source§

const CSS_CORNFLOWER_BLUE: Rgb666 = _

Cornflower Blue

source§

const CSS_CORNSILK: Rgb666 = _

Cornsilk

source§

const CSS_CRIMSON: Rgb666 = _

Crimson

source§

const CSS_CYAN: Rgb666 = _

Cyan

source§

const CSS_DARK_BLUE: Rgb666 = _

Dark Blue

source§

const CSS_DARK_CYAN: Rgb666 = _

Dark Cyan

source§

const CSS_DARK_GOLDENROD: Rgb666 = _

Dark Goldenrod

source§

const CSS_DARK_GRAY: Rgb666 = _

Dark Gray

source§

const CSS_DARK_GREEN: Rgb666 = _

Dark Green

source§

const CSS_DARK_KHAKI: Rgb666 = _

Dark Khaki

source§

const CSS_DARK_MAGENTA: Rgb666 = _

Dark Magenta

source§

const CSS_DARK_OLIVE_GREEN: Rgb666 = _

Dark Olive Green

source§

const CSS_DARK_ORANGE: Rgb666 = _

Dark Orange

source§

const CSS_DARK_ORCHID: Rgb666 = _

Dark Orchid

source§

const CSS_DARK_RED: Rgb666 = _

Dark Red

source§

const CSS_DARK_SALMON: Rgb666 = _

Dark Salmon

source§

const CSS_DARK_SEA_GREEN: Rgb666 = _

Dark Sea Green

source§

const CSS_DARK_SLATE_BLUE: Rgb666 = _

Dark Slate Blue

source§

const CSS_DARK_SLATE_GRAY: Rgb666 = _

Dark Slate Gray

source§

const CSS_DARK_TURQUOISE: Rgb666 = _

Dark Turquoise

source§

const CSS_DARK_VIOLET: Rgb666 = _

Dark Violet

source§

const CSS_DEEP_PINK: Rgb666 = _

Deep Pink

source§

const CSS_DEEP_SKY_BLUE: Rgb666 = _

Deep Sky Blue

source§

const CSS_DIM_GRAY: Rgb666 = _

Dim Gray

source§

const CSS_DODGER_BLUE: Rgb666 = _

Dodger Blue

source§

const CSS_FIRE_BRICK: Rgb666 = _

Fire Brick

source§

const CSS_FLORAL_WHITE: Rgb666 = _

Floral White

source§

const CSS_FOREST_GREEN: Rgb666 = _

Forest Green

source§

const CSS_FUCHSIA: Rgb666 = _

Fuchsia

source§

const CSS_GAINSBORO: Rgb666 = _

Gainsboro

source§

const CSS_GHOST_WHITE: Rgb666 = _

Ghost White

source§

const CSS_GOLD: Rgb666 = _

Gold

source§

const CSS_GOLDENROD: Rgb666 = _

Goldenrod

source§

const CSS_GRAY: Rgb666 = _

Gray

source§

const CSS_GREEN: Rgb666 = _

Green

source§

const CSS_GREEN_YELLOW: Rgb666 = _

Green Yellow

source§

const CSS_HONEYDEW: Rgb666 = _

Honeydew

source§

const CSS_HOT_PINK: Rgb666 = _

Hot Pink

source§

const CSS_INDIAN_RED: Rgb666 = _

Indian Red

source§

const CSS_INDIGO: Rgb666 = _

Indigo

source§

const CSS_IVORY: Rgb666 = _

Ivory

source§

const CSS_KHAKI: Rgb666 = _

Khaki

source§

const CSS_LAVENDER: Rgb666 = _

Lavender

source§

const CSS_LAVENDER_BLUSH: Rgb666 = _

Lavender Blush

source§

const CSS_LAWN_GREEN: Rgb666 = _

Lawn Green

source§

const CSS_LEMON_CHIFFON: Rgb666 = _

Lemon Chiffon

source§

const CSS_LIGHT_BLUE: Rgb666 = _

Light Blue

source§

const CSS_LIGHT_CORAL: Rgb666 = _

Light Coral

source§

const CSS_LIGHT_CYAN: Rgb666 = _

Light Cyan

source§

const CSS_LIGHT_GOLDENROD_YELLOW: Rgb666 = _

Light Goldenrod Yellow

source§

const CSS_LIGHT_GRAY: Rgb666 = _

Light Gray

source§

const CSS_LIGHT_GREEN: Rgb666 = _

Light Green

source§

const CSS_LIGHT_PINK: Rgb666 = _

Light Pink

source§

const CSS_LIGHT_SALMON: Rgb666 = _

Light Salmon

source§

const CSS_LIGHT_SEA_GREEN: Rgb666 = _

Light Sea Green

source§

const CSS_LIGHT_SKY_BLUE: Rgb666 = _

Light Sky Blue

source§

const CSS_LIGHT_SLATE_GRAY: Rgb666 = _

Light Slate Gray

source§

const CSS_LIGHT_STEEL_BLUE: Rgb666 = _

Light Steel Blue

source§

const CSS_LIGHT_YELLOW: Rgb666 = _

Light Yellow

source§

const CSS_LIME: Rgb666 = _

Lime

source§

const CSS_LIME_GREEN: Rgb666 = _

Lime Green

source§

const CSS_LINEN: Rgb666 = _

Linen

source§

const CSS_MAGENTA: Rgb666 = _

Magenta

source§

const CSS_MAROON: Rgb666 = _

Maroon

source§

const CSS_MEDIUM_AQUAMARINE: Rgb666 = _

Medium Aquamarine

source§

const CSS_MEDIUM_BLUE: Rgb666 = _

Medium Blue

source§

const CSS_MEDIUM_ORCHID: Rgb666 = _

Medium Orchid

source§

const CSS_MEDIUM_PURPLE: Rgb666 = _

Medium Purple

source§

const CSS_MEDIUM_SEA_GREEN: Rgb666 = _

Medium Sea Green

source§

const CSS_MEDIUM_SLATE_BLUE: Rgb666 = _

Medium Slate Blue

source§

const CSS_MEDIUM_SPRING_GREEN: Rgb666 = _

Medium Spring Green

source§

const CSS_MEDIUM_TURQUOISE: Rgb666 = _

Medium Turquoise

source§

const CSS_MEDIUM_VIOLET_RED: Rgb666 = _

Medium Violet Red

source§

const CSS_MIDNIGHT_BLUE: Rgb666 = _

Midnight Blue

source§

const CSS_MINT_CREAM: Rgb666 = _

Mint Cream

source§

const CSS_MISTY_ROSE: Rgb666 = _

Misty Rose

source§

const CSS_MOCCASIN: Rgb666 = _

Moccasin

source§

const CSS_NAVAJO_WHITE: Rgb666 = _

Navajo White

source§

const CSS_NAVY: Rgb666 = _

Navy

source§

const CSS_OLD_LACE: Rgb666 = _

Old Lace

source§

const CSS_OLIVE: Rgb666 = _

Olive

source§

const CSS_OLIVE_DRAB: Rgb666 = _

Olive Drab

source§

const CSS_ORANGE: Rgb666 = _

Orange

source§

const CSS_ORANGE_RED: Rgb666 = _

Orange Red

source§

const CSS_ORCHID: Rgb666 = _

Orchid

source§

const CSS_PALE_GOLDENROD: Rgb666 = _

Pale Goldenrod

source§

const CSS_PALE_GREEN: Rgb666 = _

Pale Green

source§

const CSS_PALE_TURQUOISE: Rgb666 = _

Pale Turquoise

source§

const CSS_PALE_VIOLET_RED: Rgb666 = _

Pale Violet Red

source§

const CSS_PAPAYA_WHIP: Rgb666 = _

Papaya Whip

source§

const CSS_PEACH_PUFF: Rgb666 = _

Peach Puff

source§

const CSS_PERU: Rgb666 = _

Peru

source§

const CSS_PINK: Rgb666 = _

Pink

source§

const CSS_PLUM: Rgb666 = _

Plum

source§

const CSS_POWDER_BLUE: Rgb666 = _

Powder Blue

source§

const CSS_PURPLE: Rgb666 = _

Purple

source§

const CSS_REBECCAPURPLE: Rgb666 = _

Rebeccapurple

source§

const CSS_RED: Rgb666 = _

Red

source§

const CSS_ROSY_BROWN: Rgb666 = _

Rosy Brown

source§

const CSS_ROYAL_BLUE: Rgb666 = _

Royal Blue

source§

const CSS_SADDLE_BROWN: Rgb666 = _

Saddle Brown

source§

const CSS_SALMON: Rgb666 = _

Salmon

source§

const CSS_SANDY_BROWN: Rgb666 = _

Sandy Brown

source§

const CSS_SEA_GREEN: Rgb666 = _

Sea Green

source§

const CSS_SEASHELL: Rgb666 = _

Seashell

source§

const CSS_SIENNA: Rgb666 = _

Sienna

source§

const CSS_SILVER: Rgb666 = _

Silver

source§

const CSS_SKY_BLUE: Rgb666 = _

Sky Blue

source§

const CSS_SLATE_BLUE: Rgb666 = _

Slate Blue

source§

const CSS_SLATE_GRAY: Rgb666 = _

Slate Gray

source§

const CSS_SNOW: Rgb666 = _

Snow

source§

const CSS_SPRING_GREEN: Rgb666 = _

Spring Green

source§

const CSS_STEEL_BLUE: Rgb666 = _

Steel Blue

source§

const CSS_TAN: Rgb666 = _

Tan

source§

const CSS_TEAL: Rgb666 = _

Teal

source§

const CSS_THISTLE: Rgb666 = _

Thistle

source§

const CSS_TOMATO: Rgb666 = _

Tomato

source§

const CSS_TURQUOISE: Rgb666 = _

Turquoise

source§

const CSS_VIOLET: Rgb666 = _

Violet

source§

const CSS_WHEAT: Rgb666 = _

Wheat

source§

const CSS_WHITE: Rgb666 = _

White

source§

const CSS_WHITE_SMOKE: Rgb666 = _

White Smoke

source§

const CSS_YELLOW: Rgb666 = _

Yellow

source§

const CSS_YELLOW_GREEN: Rgb666 = _

Yellow Green

source§

impl Copy for Rgb666

source§

impl Eq for Rgb666

source§

impl StructuralPartialEq for Rgb666

Auto Trait Implementations§

§

impl Freeze for Rgb666

§

impl RefUnwindSafe for Rgb666

§

impl Send for Rgb666

§

impl Sync for Rgb666

§

impl Unpin for Rgb666

§

impl UnwindSafe for Rgb666

Blanket Implementations§

§

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

§

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.
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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.
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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.