#[repr(C)]pub struct Color32(_);
Expand description
Implementations
sourceimpl Color32
impl Color32
pub const TRANSPARENT: Color32 = Color32::from_rgba_premultiplied(0, 0, 0, 0)
pub const BLACK: Color32 = Color32::from_rgb(0, 0, 0)
pub const DARK_GRAY: Color32 = Color32::from_rgb(96, 96, 96)
pub const GRAY: Color32 = Color32::from_rgb(160, 160, 160)
pub const LIGHT_GRAY: Color32 = Color32::from_rgb(220, 220, 220)
pub const WHITE: Color32 = Color32::from_rgb(255, 255, 255)
pub const BROWN: Color32 = Color32::from_rgb(165, 42, 42)
pub const DARK_RED: Color32 = Color32::from_rgb(139, 0, 0)
pub const RED: Color32 = Color32::from_rgb(255, 0, 0)
pub const LIGHT_RED: Color32 = Color32::from_rgb(255, 128, 128)
pub const YELLOW: Color32 = Color32::from_rgb(255, 255, 0)
pub const LIGHT_YELLOW: Color32 = Color32::from_rgb(255, 255, 224)
pub const KHAKI: Color32 = Color32::from_rgb(240, 230, 140)
pub const DARK_GREEN: Color32 = Color32::from_rgb(0, 100, 0)
pub const GREEN: Color32 = Color32::from_rgb(0, 255, 0)
pub const LIGHT_GREEN: Color32 = Color32::from_rgb(144, 238, 144)
pub const DARK_BLUE: Color32 = Color32::from_rgb(0, 0, 139)
pub const BLUE: Color32 = Color32::from_rgb(0, 0, 255)
pub const LIGHT_BLUE: Color32 = Color32::from_rgb(173, 216, 230)
pub const GOLD: Color32 = Color32::from_rgb(255, 215, 0)
pub const DEBUG_COLOR: Color32 = Color32::from_rgba_premultiplied(0, 200, 0, 128)
sourcepub const TEMPORARY_COLOR: Color32 = Color32::from_rgb(64, 254, 0)
pub const TEMPORARY_COLOR: Color32 = Color32::from_rgb(64, 254, 0)
An ugly color that is planned to be replaced before making it to the screen.
pub const fn from_rgb(r: u8, g: u8, b: u8) -> Color32
pub const fn from_rgb_additive(r: u8, g: u8, b: u8) -> Color32
sourcepub const fn from_rgba_premultiplied(r: u8, g: u8, b: u8, a: u8) -> Color32
pub const fn from_rgba_premultiplied(r: u8, g: u8, b: u8, a: u8) -> Color32
From sRGBA
with premultiplied alpha.
sourcepub fn from_rgba_unmultiplied(r: u8, g: u8, b: u8, a: u8) -> Color32
pub fn from_rgba_unmultiplied(r: u8, g: u8, b: u8, a: u8) -> Color32
From sRGBA
WITHOUT premultiplied alpha.
pub const fn from_gray(l: u8) -> Color32
pub const fn from_black_alpha(a: u8) -> Color32
pub fn from_white_alpha(a: u8) -> Color32
pub const fn from_additive_luminance(l: u8) -> Color32
pub const fn is_opaque(&self) -> bool
pub const fn r(&self) -> u8
pub const fn g(&self) -> u8
pub const fn b(&self) -> u8
pub const fn a(&self) -> u8
pub fn to_srgba_unmultiplied(&self) -> [u8; 4]
sourcepub fn linear_multiply(self, factor: f32) -> Color32
pub fn linear_multiply(self, factor: f32) -> Color32
Multiply with 0.5 to make color half as opaque.
Trait Implementations
impl Copy for Color32
impl Eq for Color32
impl StructuralEq for Color32
impl StructuralPartialEq for Color32
Auto Trait Implementations
impl RefUnwindSafe for Color32
impl Send for Color32
impl Sync for Color32
impl Unpin for Color32
impl UnwindSafe for Color32
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more