pub struct Color { /* private fields */ }
Expand description
A simple RGBA based color
Implementations§
source§impl Color
impl Color
sourcepub fn new_from_hex(rgba_hex: u32) -> Self
pub fn new_from_hex(rgba_hex: u32) -> Self
Create a new Color from a hex encoded u32: 0xRRGGBB or 0xRRGGBBAA
sourcepub fn rgb(&self) -> (f64, f64, f64)
pub fn rgb(&self) -> (f64, f64, f64)
The RGB information of this color as 0.0-1.0 range floats representing proportions of 255 for each of R, G, B
sourcepub fn rgba(&self) -> (f64, f64, f64, f64)
pub fn rgba(&self) -> (f64, f64, f64, f64)
The RGBA information of this color as 0.0-1.0 range floats representing proportions of 255 for each of R, G, B, A
sourcepub fn as_rgb_hex_string(&self) -> String
pub fn as_rgb_hex_string(&self) -> String
Render this color as a #RRGGBB hew color string
Trait Implementations§
source§impl PartialEq for Color
impl PartialEq for Color
impl Copy for Color
impl Eq for Color
impl StructuralEq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
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