#[non_exhaustive]pub enum CssColor {
Rgb(u8, u8, u8),
Rgba(u8, u8, u8, UnitInterval),
Hsl(FiniteF64, PercentageChannel, PercentageChannel),
Hsla(FiniteF64, PercentageChannel, PercentageChannel, UnitInterval),
Named(CssColorName),
}Expand description
CSS color values from CSS Color Level 4.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Rgb(u8, u8, u8)
RGB color (e.g., rgb(255, 128, 0)).
Rgba(u8, u8, u8, UnitInterval)
RGBA color with alpha (e.g., rgba(255, 128, 0, 0.5)).
Hsl(FiniteF64, PercentageChannel, PercentageChannel)
HSL color (e.g., hsl(120, 100%, 50%)).
Hue in degrees (any finite value; CSS wraps it around the 0-360 degree color wheel),
saturation and lightness as percentages (0-100).
Hsla(FiniteF64, PercentageChannel, PercentageChannel, UnitInterval)
HSLA color with alpha (e.g., hsla(120, 100%, 50%, 0.5)).
Hue in degrees (any finite value; CSS wraps it around the 0-360 degree color wheel),
saturation and lightness as percentages (0-100), alpha (0.0-1.0).
Named(CssColorName)
A CSS named color.
Trait Implementations§
impl Copy for CssColor
Source§impl CssWriteTo for CssColor
impl CssWriteTo for CssColor
impl StructuralPartialEq for CssColor
Auto Trait Implementations§
impl Freeze for CssColor
impl RefUnwindSafe for CssColor
impl Send for CssColor
impl Sync for CssColor
impl Unpin for CssColor
impl UnsafeUnpin for CssColor
impl UnwindSafe for CssColor
Blanket Implementations§
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
impl<T> CheckedCssValue for Twhere
T: CssWriteTo + Sealed,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.