#[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
sourceimpl<'de> Deserialize<'de> for Color32
impl<'de> Deserialize<'de> for Color32
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Color32, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Color32, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Color32> for Color32
impl PartialEq<Color32> for Color32
sourceimpl Serialize for Color32
impl Serialize for Color32
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Color32
impl Eq for Color32
impl Pod 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
impl<T> CheckedBitPattern for T where
T: AnyBitPattern,
impl<T> CheckedBitPattern for T where
T: AnyBitPattern,
type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
. Read more
fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret bits
as &Self
. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more