Struct comfy_core::Color
source · #[repr(C)]pub struct Color {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}Fields§
§r: f32§g: f32§b: f32§a: f32Implementations§
source§impl Color
impl Color
pub const fn new(r: f32, g: f32, b: f32, a: f32) -> Self
pub const fn gray(value: f32) -> Self
pub const fn rgb(r: f32, g: f32, b: f32) -> Self
pub fn rgb8(r: u8, g: u8, b: u8) -> Self
pub fn rgba8(r: u8, g: u8, b: u8, a: u8) -> Self
pub fn egui(self) -> Color32
pub fn to_vec4(&self) -> Vec4
pub fn to_array(self) -> [u8; 4]
pub fn alpha(&self, value: f32) -> Color
pub fn mix(&self, other: Color, value: f32) -> Color
pub fn to_image_rgba(self) -> Rgba<u8>
pub fn darken(&self, amount: f32) -> Color
pub fn lighten(&self, amount: f32) -> Color
pub fn boost(&self, amount: f32) -> Color
Trait Implementations§
source§impl PartialEq for Color
impl PartialEq for Color
impl Copy for Color
impl Pod for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
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
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
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.source§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.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().