pub struct RgbColor(/* private fields */);Expand description
A validated DrawingML sRGB colour.
Implementations§
Source§impl RgbColor
impl RgbColor
Sourcepub const fn new(red: u8, green: u8, blue: u8) -> RgbColor
pub const fn new(red: u8, green: u8, blue: u8) -> RgbColor
Creates a colour from its red, green, and blue components.
Sourcepub fn parse(value: &str) -> Result<RgbColor, ColorError>
pub fn parse(value: &str) -> Result<RgbColor, ColorError>
Parses an RRGGBB DrawingML colour value.
Sourcepub const fn components(self) -> [u8; 3]
pub const fn components(self) -> [u8; 3]
Returns the red, green, and blue components.
Trait Implementations§
impl Copy for RgbColor
impl Eq for RgbColor
impl StructuralPartialEq for RgbColor
Auto Trait Implementations§
impl Freeze for RgbColor
impl RefUnwindSafe for RgbColor
impl Send for RgbColor
impl Sync for RgbColor
impl Unpin for RgbColor
impl UnsafeUnpin for RgbColor
impl UnwindSafe for RgbColor
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.