#[repr(C)]pub enum HexColor {
Hex3(Color32),
Hex4(Color32),
Hex6(Color32),
Hex8(Color32),
}
Expand description
Variants§
Hex3(Color32)
3 hexadecimal digits, one for each of the r, g, b channels
Hex4(Color32)
4 hexadecimal digits, one for each of the r, g, b, a channels
Hex6(Color32)
6 hexadecimal digits, two for each of the r, g, b channels
Hex8(Color32)
8 hexadecimal digits, one for each of the r, g, b, a channels
Implementations§
Source§impl HexColor
impl HexColor
Sourcepub fn from_str_without_hash(s: &str) -> Result<HexColor, ParseHexColorError>
pub fn from_str_without_hash(s: &str) -> Result<HexColor, ParseHexColorError>
Parses a string as a hex color without the leading #
character
§Errors
Returns an error if the length of the string does not correspond to one of the standard formats (3, 4, 6, or 8), or if it contains non-hex characters.
Trait Implementations§
impl Copy for HexColor
impl Eq for HexColor
impl StructuralPartialEq for HexColor
Auto Trait Implementations§
impl Freeze for HexColor
impl RefUnwindSafe for HexColor
impl Send for HexColor
impl Sync for HexColor
impl Unpin for HexColor
impl UnwindSafe for HexColor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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 more