pub struct Color { /* private fields */ }
Expand description
A color in RGBA (Red-Green-Blue-Alpha) format.
See https://unifiedfontobject.org/versions/ufo3/conventions/#colors.
Implementations§
source§impl Color
impl Color
sourcepub fn to_rgba_string(&self) -> String
pub fn to_rgba_string(&self) -> String
Serializes the color into a string as defined by the UFO specification.
Precision is limited to three decimal places, which is enough to losslessly
roundtrip to colors represented by u8
tuples.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
source§fn deserialize<D>(deserializer: D) -> Result<Color, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Color, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Color
impl PartialEq 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<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