#[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<Self, ParseHexColorError>
pub fn from_str_without_hash(s: &str) -> Result<Self, 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§
Source§impl<'de> Deserialize<'de> for HexColor
impl<'de> Deserialize<'de> for HexColor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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