pub struct RgbaColor {}Implementations§
Source§impl RgbaColor
impl RgbaColor
Sourcepub fn random_rgb_color() -> u32
pub fn random_rgb_color() -> u32
Creates random opaque rgb color
Sourcepub fn random_rgba_color() -> u32
pub fn random_rgba_color() -> u32
Creates random rgba color (can be transparent, see RgbaColor::random_rgb_color() for opaque colors)
Sourcepub fn greyscale_color(g: u8) -> u32
pub fn greyscale_color(g: u8) -> u32
Creates rgba value based on greyscale u8 value
Sourcepub fn color_alpha(color: u32) -> u8
pub fn color_alpha(color: u32) -> u8
Extracts alpha channel as u8 from u32 color
Sourcepub fn color_green(color: u32) -> u8
pub fn color_green(color: u32) -> u8
Extracts green channel as u8 from u32 color
Sourcepub fn color_blue(color: u32) -> u8
pub fn color_blue(color: u32) -> u8
Extracts blue channel as u8 from u32 color
Auto Trait Implementations§
impl Freeze for RgbaColor
impl RefUnwindSafe for RgbaColor
impl Send for RgbaColor
impl Sync for RgbaColor
impl Unpin for RgbaColor
impl UnwindSafe for RgbaColor
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more