kludgine

Struct Color

Source
#[repr(C)]
pub struct Color(pub u32);
Expand description

A red, green, blue, and alpha color value stored in 32-bits.

Tuple Fields§

§0: u32

Implementations§

Source§

impl Color

Source

pub const fn new(red: u8, green: u8, blue: u8, alpha: u8) -> Self

Returns a new color with the provided components.

Source

pub fn new_f32(red: f32, green: f32, blue: f32, alpha: f32) -> Self

Returns a new color by converting each component from its 0.0..=1.0 range into a 0..=255 range.

Source

pub const fn red(self) -> u8

Returns the red component of this color, range 0-255.

Source

pub fn red_f32(self) -> f32

Returns the red component of this color, range 0.0-1.0.

Source

pub const fn green(self) -> u8

Returns the green component of this color, range 0-255.

Source

pub fn green_f32(self) -> f32

Returns the green component of this color, range 0.0-1.0.

Source

pub const fn blue(self) -> u8

Returns the blue component of this color, range 0-255.

Source

pub fn blue_f32(self) -> f32

Returns the blue component of this color, range 0.0-1.0.

Source

pub const fn alpha(self) -> u8

Returns the alpha component of this color, range 0-255. A value of 255 is completely opaque.

Source

pub fn alpha_f32(self) -> f32

Returns the alpha component of this color, range 0.0-1.0. A value of 1.0 is completely opaque.

Source

pub const fn with_red(self, red: u8) -> Self

Returns a new color replacing this colors red channel with red.

Source

pub const fn with_green(self, red: u8) -> Self

Returns a new color replacing this colors green channel with green.

Source

pub const fn with_blue(self, blue: u8) -> Self

Returns a new color replacing this colors blue channel with blue.

Source

pub const fn with_alpha(self, alpha: u8) -> Self

Returns a new color replacing this colors alpha channel with alpha.

Source

pub fn with_red_f32(self, red: f32) -> Self

Returns a new color replacing this colors red channel with red.

Source

pub fn with_green_f32(self, green: f32) -> Self

Returns a new color replacing this colors green channel with green.

Source

pub fn with_blue_f32(self, blue: f32) -> Self

Returns a new color replacing this colors blue channel with blue.

Source

pub fn with_alpha_f32(self, alpha: f32) -> Self

Returns a new color replacing this colors alpha channel with alpha.

Source§

impl Color

Source

pub const ALICEBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const ANTIQUEWHITE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const AQUA: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const AQUAMARINE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const AZURE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const BEIGE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const BISQUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const BLACK: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const BLANCHEDALMOND: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const BLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const BLUEVIOLET: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const BROWN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const BURLYWOOD: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CADETBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CHARTREUSE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CHOCOLATE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CLEAR_BLACK: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CLEAR_WHITE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CORAL: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CORNFLOWERBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CORNSILK: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CRIMSON: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const CYAN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKCYAN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKGOLDENROD: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKGRAY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKGREY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKKHAKI: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKMAGENTA: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKOLIVEGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKORANGE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKORCHID: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKRED: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKSALMON: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKSEAGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKSLATEBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKSLATEGRAY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKSLATEGREY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKTURQUOISE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DARKVIOLET: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DEEPPINK: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DEEPSKYBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DIMGRAY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DIMGREY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const DODGERBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const FIREBRICK: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const FLORALWHITE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const FORESTGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const FUCHSIA: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const GAINSBORO: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const GHOSTWHITE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const GOLD: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const GOLDENROD: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const GRAY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const GREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const GREENYELLOW: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const GREY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const HONEYDEW: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const HOTPINK: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const INDIANRED: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const INDIGO: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const IVORY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const KHAKI: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LAVENDER: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LAVENDERBLUSH: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LAWNGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LEMONCHIFFON: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTCORAL: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTCYAN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTGOLDENRODYELLOW: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTGRAY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTGREY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTPINK: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTSALMON: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTSEAGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTSKYBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTSLATEGRAY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTSLATEGREY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTSTEELBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIGHTYELLOW: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIME: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LIMEGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const LINEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MAGENTA: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MAROON: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMAQUAMARINE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMORCHID: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMPURPLE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMSEAGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMSLATEBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMSPRINGGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMTURQUOISE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MEDIUMVIOLETRED: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MIDNIGHTBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MINTCREAM: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MISTYROSE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const MOCCASIN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const NAVAJOWHITE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const NAVY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const OLDLACE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const OLIVE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const OLIVEDRAB: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const ORANGE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const ORANGERED: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const ORCHID: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PALEGOLDENROD: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PALEGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PALETURQUOISE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PALEVIOLETRED: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PAPAYAWHIP: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PEACHPUFF: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PERU: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PINK: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PLUM: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const POWDERBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const PURPLE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const REBECCAPURPLE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const RED: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const ROSYBROWN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const ROYALBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SADDLEBROWN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SALMON: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SANDYBROWN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SEAGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SEASHELL: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SIENNA: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SILVER: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SKYBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SLATEBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SLATEGRAY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SLATEGREY: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SNOW: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const SPRINGGREEN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const STEELBLUE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const TAN: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const TEAL: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const THISTLE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const TOMATO: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const TURQUOISE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const VIOLET: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const WHEAT: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const WHITE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const WHITESMOKE: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const YELLOW: Self

Equivalent to the CSS color keywords of the same name.

Source

pub const YELLOWGREEN: Self

Equivalent to the CSS color keywords of the same name.

Trait Implementations§

Source§

impl Clone for Color

Source§

fn clone(&self) -> Color

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 Color

Source§

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

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

impl From<BackendColor> for Color

Source§

fn from(value: BackendColor) -> Self

Converts to this type from the input type.
Source§

impl From<Color> for BackendColor

Source§

fn from(value: Color) -> Self

Converts to this type from the input type.
Source§

impl From<Color> for Color

Source§

fn from(color: Color) -> Self

Converts to this type from the input type.
Source§

impl From<Color> for Color

Source§

fn from(value: Color) -> Self

Converts to this type from the input type.
Source§

impl From<Color> for Color

Source§

fn from(value: Color) -> Self

Converts to this type from the input type.
Source§

impl<Unit> From<Color> for StrokeOptions<Unit>
where Unit: DefaultStrokeWidth,

Source§

fn from(color: Color) -> Self

Converts to this type from the input type.
Source§

impl Hash for Color

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 PartialEq for Color

Source§

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

§

fn zeroed() -> Self

Source§

impl Copy for Color

Source§

impl Eq for Color

Source§

impl Pod for Color

Source§

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 S
where 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) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
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, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

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

Converts self into C, using the provided parameters.
§

impl<A> Cast for A

§

fn cast<To>(self) -> To
where To: CastFrom<A>,

Casts self to the To type. This may be a lossy operation.
§

impl<A> CastFrom<A> for A

§

fn from_cast(from: A) -> A

Returns from as Self.
§

impl<A, B> CastInto<A> for B
where A: CastFrom<B>,

§

fn cast_into(self) -> A

Returns self as To.
§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

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

Source§

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

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

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

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

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

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 T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
§

impl<Unit> IntoComponents<Unit> for Unit
where Unit: Copy,

§

fn into_components(self) -> (Unit, Unit)

Extracts this type’s 2d vector components.
§

fn to_vec<Type>(self) -> Type
where Type: FromComponents<Unit>,

Converts this type to another type using [FromComponents] and [IntoComponents].
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

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, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

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>

Try to cast this collection of color components into a collection of colors. Read more
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, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

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

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> AnyBitPattern for T
where T: Pod,

§

impl<T> NoUninit for T
where T: Pod,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,