pub struct Color {
pub r: u8,
pub g: u8,
pub b: u8,
}
Expand description
RGB Color struct.
Fields:
Color.r
Color.g
Color.b
Fields§
§r: u8
§g: u8
§b: u8
Implementations§
Source§impl Color
impl Color
pub const ALICE_BLUE: Color
pub const ANTIQUE_WHITE: Color
pub const AQUA: Color
pub const AQUAMARINE: Color
pub const AZURE: Color
pub const BEIGE: Color
pub const BISQUE: Color
pub const BLACK: Color
pub const BLANCHED_ALMOND: Color
pub const BLUE: Color
pub const BLUE_VIOLET: Color
pub const BROWN: Color
pub const BURLYWOOD: Color
pub const CADET_BLUE: Color
pub const CHARTREUSE: Color
pub const CHOCOLATE: Color
pub const CORAL: Color
pub const CORNFLOWER_BLUE: Color
pub const CORNSILK: Color
pub const CRIMSON: Color
pub const CYAN: Color
pub const DARK_BLUE: Color
pub const DARK_CYAN: Color
pub const DARK_GOLDENROD: Color
pub const DARK_GRAY: Color
pub const DARK_GREEN: Color
pub const DARK_KHAKI: Color
pub const DARK_MAGENTA: Color
pub const DARK_OLIVE_GREEN: Color
pub const DARK_ORANGE: Color
pub const DARK_ORCHID: Color
pub const DARK_RED: Color
pub const DARK_SALMON: Color
pub const DARK_SEA_GREEN: Color
pub const DARK_SLATE_BLUE: Color
pub const DARK_SLATE_GRAY: Color
pub const DARK_TURQUOISE: Color
pub const DARK_VIOLET: Color
pub const DEEP_PINK: Color
pub const DEEP_SKY_BLUE: Color
pub const DIM_GRAY: Color
pub const DODGER_BLUE: Color
pub const FIREBRICK: Color
pub const FLORAL_WHITE: Color
pub const FOREST_GREEN: Color
pub const FUCHSIA: Color
pub const GAINSBORO: Color
pub const GHOST_WHITE: Color
pub const GOLD: Color
pub const GOLDENROD: Color
pub const GRAY: Color
pub const GREEN: Color
pub const GREEN_YELLOW: Color
pub const HONEYDEW: Color
pub const HOT_PINK: Color
pub const INDIAN_RED: Color
pub const INDIGO: Color
pub const IVORY: Color
pub const KHAKI: Color
pub const LAVENDER: Color
pub const LAVENDER_BLUSH: Color
pub const LAWN_GREEN: Color
pub const LEMON_CHIFFON: Color
pub const LIGHT_BLUE: Color
pub const LIGHT_CORAL: Color
pub const LIGHT_CYAN: Color
pub const LIGHT_GOLDENROD: Color
pub const LIGHT_GRAY: Color
pub const LIGHT_GREEN: Color
pub const LIGHT_PINK: Color
pub const LIGHT_SALMON: Color
pub const LIGHT_SEA_GREEN: Color
pub const LIGHT_SKY_BLUE: Color
pub const LIGHT_SLATE_GRAY: Color
pub const LIGHT_STEEL_BLUE: Color
pub const LIGHT_YELLOW: Color
pub const LIME: Color
pub const LIME_GREEN: Color
pub const LINEN: Color
pub const MAGENTA: Color
pub const MAROON: Color
pub const MEDIUM_AQUAMARINE: Color
pub const MEDIUM_BLUE: Color
pub const MEDIUM_ORCHID: Color
pub const MEDIUM_PURPLE: Color
pub const MEDIUM_SEA_GREEN: Color
pub const MEDIUM_SLATE_BLUE: Color
pub const MEDIUM_SPRING_GREEN: Color
pub const MEDIUM_TURQUOISE: Color
pub const MEDIUM_VIOLET_RED: Color
pub const MIDNIGHT_BLUE: Color
pub const MINT_CREAM: Color
pub const MISTY_ROSE: Color
pub const MOCCASIN: Color
pub const NAVAJO_WHITE: Color
pub const NAVY_BLUE: Color
pub const OLD_LACE: Color
pub const OLIVE: Color
pub const OLIVE_DRAB: Color
pub const ORANGE: Color
pub const ORANGE_RED: Color
pub const ORCHID: Color
pub const PALE_GOLDENROD: Color
pub const PALE_GREEN: Color
pub const PALE_TURQUOISE: Color
pub const PALE_VIOLET_RED: Color
pub const PAPAYA_WHIP: Color
pub const PEACH_PUFF: Color
pub const PERU: Color
pub const PINK: Color
pub const PLUM: Color
pub const POWDER_BLUE: Color
pub const PURPLE: Color
pub const REBECCA_PURPLE: Color
pub const RED: Color
pub const ROSY_BROWN: Color
pub const ROYAL_BLUE: Color
pub const SADDLE_BROWN: Color
pub const SALMON: Color
pub const SANDY_BROWN: Color
pub const SEA_GREEN: Color
pub const SEASHELL: Color
pub const SIENNA: Color
pub const SILVER: Color
pub const SKY_BLUE: Color
pub const SLATE_BLUE: Color
pub const SLATE_GRAY: Color
pub const SNOW: Color
pub const SPRING_GREEN: Color
pub const STEEL_BLUE: Color
pub const TAN: Color
pub const TEAL: Color
pub const THISTLE: Color
pub const TOMATO: Color
pub const TRANSPARENT: Color
pub const TURQUOISE: Color
pub const VIOLET: Color
pub const WEB_GRAY: Color
pub const WEB_GREEN: Color
pub const WEB_MAROON: Color
pub const WEB_PURPLE: Color
pub const WHEAT: Color
pub const WHITE: Color
pub const WHITE_SMOKE: Color
pub const YELLOW: Color
pub const YELLOW_GREEN: Color
pub fn raw_rgb(r: f32, g: f32, b: f32) -> Self
pub fn raw_vec3_rgb(c: Vec3f) -> Self
pub fn okhsl(h: f32, s: f32, l: f32) -> Self
pub fn get_raw(&self) -> (f32, f32, f32)
pub fn get_raw_vec3f(&self) -> Vec3f
pub fn get_okhsl(&self) -> (f32, f32, f32)
pub fn blend(a: Color, b: Color, mode: BlendMode) -> Self
Trait Implementations§
impl Copy for Color
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Convert the source color to the destination color using the specified
method.
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default.
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Cast a collection of colors into a collection of arrays.
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
Cast this collection of arrays into a collection of colors.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
The number type that’s used in
parameters
when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self
into C
, using the provided parameters.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Cast a collection of colors into a collection of color components.
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
Performs a conversion from
angle
.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
Converts
other
into Self
, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
Performs a conversion into
T
.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
The number type that’s used in
parameters
when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self
into C
, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
Converts
self
into T
, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
The error for when
try_into_colors
fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Try to cast this collection of color components into a collection of
colors. Read more
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more