pub struct Color(/* private fields */);
Expand description
Colors in NanoVG are stored as unsigned ints in ABGR format.
Implementations§
source§impl Color
impl Color
sourcepub fn from_rgb(r: u8, g: u8, b: u8) -> Self
pub fn from_rgb(r: u8, g: u8, b: u8) -> Self
Returns a color value from red, green, blue values. Alpha will be set to 255 (1.0).
sourcepub fn from_rgbf(r: f32, g: f32, b: f32) -> Self
pub fn from_rgbf(r: f32, g: f32, b: f32) -> Self
Returns a color value from red, green, blue values. Alpha will be set to 1.0f.
sourcepub fn from_rgba(r: u8, g: u8, b: u8, a: u8) -> Self
pub fn from_rgba(r: u8, g: u8, b: u8, a: u8) -> Self
Returns a color value from red, green, blue and alpha values.
sourcepub fn from_rgbaf(r: f32, g: f32, b: f32, a: f32) -> Self
pub fn from_rgbaf(r: f32, g: f32, b: f32, a: f32) -> Self
Returns a color value from red, green, blue values. Alpha will be set to 1.0f.
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