Struct egui::Color32[][src]

pub struct Color32(_);

This format is used for space-efficient color representation (32 bits).

Instead of manipulating this directly it is often better to first convert it to either Rgba or Hsva.

Internally this uses 0-255 gamma space sRGBA color with premultiplied alpha. Alpha channel is in linear space.

Implementations

impl Color32[src]

pub const TRANSPARENT: Color32[src]

pub const BLACK: Color32[src]

pub const LIGHT_GRAY: Color32[src]

pub const GRAY: Color32[src]

pub const WHITE: Color32[src]

pub const RED: Color32[src]

pub const YELLOW: Color32[src]

pub const GREEN: Color32[src]

pub const BLUE: Color32[src]

pub const LIGHT_BLUE: Color32[src]

pub const GOLD: Color32[src]

pub const fn from_rgb(r: u8, g: u8, b: u8) -> Color32[src]

pub const fn from_rgb_additive(r: u8, g: u8, b: u8) -> Color32[src]

pub const fn from_rgba_premultiplied(r: u8, g: u8, b: u8, a: u8) -> Color32[src]

From sRGBA with premultiplied alpha.

pub fn from_rgba_unmultiplied(r: u8, g: u8, b: u8, a: u8) -> Color32[src]

From sRGBA WITHOUT premultiplied alpha.

pub const fn new(r: u8, g: u8, b: u8, a: u8) -> Color32[src]

👎 Deprecated:

Use from_rgb(..), from_rgba_premultiplied(..) or from_srgba_unmultiplied(..)

pub const fn from_gray(l: u8) -> Color32[src]

pub const fn from_black_alpha(a: u8) -> Color32[src]

pub fn from_white_alpha(a: u8) -> Color32[src]

pub const fn from_additive_luminance(l: u8) -> Color32[src]

pub fn is_opaque(&self) -> bool[src]

pub fn r(&self) -> u8[src]

pub fn g(&self) -> u8[src]

pub fn b(&self) -> u8[src]

pub fn a(&self) -> u8[src]

pub fn to_opaque(self) -> Color32[src]

Returns an opaque version of self

pub fn additive(self) -> Color32[src]

Returns an additive version of self

pub fn to_array(&self) -> [u8; 4][src]

Premultiplied RGBA

pub fn to_tuple(&self) -> (u8, u8, u8, u8)[src]

Premultiplied RGBA

pub fn linear_multiply(self, factor: f32) -> Color32[src]

Multiply with 0.5 to make color half as opaque.

Trait Implementations

impl Clone for Color32[src]

pub fn clone(&self) -> Color32[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Color32[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Default for Color32[src]

pub fn default() -> Color32[src]

Returns the “default value” for a type. Read more

impl From<Color32> for Hsva[src]

pub fn from(srgba: Color32) -> Hsva[src]

Performs the conversion.

impl From<Color32> for Rgba[src]

pub fn from(srgba: Color32) -> Rgba[src]

Performs the conversion.

impl From<Color32> for HsvaGamma[src]

pub fn from(srgba: Color32) -> HsvaGamma[src]

Performs the conversion.

impl From<Hsva> for Color32[src]

pub fn from(hsva: Hsva) -> Color32[src]

Performs the conversion.

impl From<HsvaGamma> for Color32[src]

pub fn from(hsvag: HsvaGamma) -> Color32[src]

Performs the conversion.

impl From<Rgba> for Color32[src]

pub fn from(rgba: Rgba) -> Color32[src]

Performs the conversion.

impl Hash for Color32[src]

pub fn hash<__H>(&self, state: &mut __H) where
    __H: Hasher
[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl Index<usize> for Color32[src]

type Output = u8

The returned type after indexing.

pub fn index(&self, index: usize) -> &u8[src]

Performs the indexing (container[index]) operation. Read more

impl IndexMut<usize> for Color32[src]

pub fn index_mut(&mut self, index: usize) -> &mut u8[src]

Performs the mutable indexing (container[index]) operation. Read more

impl PartialEq<Color32> for Color32[src]

pub fn eq(&self, other: &Color32) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &Color32) -> bool[src]

This method tests for !=.

impl Copy for Color32[src]

impl Eq for Color32[src]

impl StructuralEq for Color32[src]

impl StructuralPartialEq for Color32[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CallHasher for T where
    T: Hash + ?Sized

pub default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
    B: BuildHasher,
    H: Hash + ?Sized

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.