pub struct Rgba {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}Expand description
Linear RGB color with alpha, all in [0.0, 1.0].
Fields§
§r: f32§g: f32§b: f32§a: f32Implementations§
Source§impl Rgba
impl Rgba
pub const WHITE: Rgba
pub const BLACK: Rgba
pub const RED: Rgba
pub const GREEN: Rgba
pub const BLUE: Rgba
pub const YELLOW: Rgba
pub const CYAN: Rgba
pub const MAGENTA: Rgba
pub const TRANSPARENT: Rgba
pub fn new(r: f32, g: f32, b: f32, a: f32) -> Self
pub fn rgb(r: f32, g: f32, b: f32) -> Self
pub fn from_vec4(v: Vec4) -> Self
pub fn to_vec4(self) -> Vec4
pub fn to_vec3(self) -> Vec3
Sourcepub fn from_hex_alpha(hex: u32) -> Self
pub fn from_hex_alpha(hex: u32) -> Self
Construct from an 0xRRGGBBAA hex literal.
pub fn with_alpha(self, a: f32) -> Self
pub fn lerp(self, other: Rgba, t: f32) -> Self
Trait Implementations§
impl Copy for Rgba
impl StructuralPartialEq for Rgba
Auto Trait Implementations§
impl Freeze for Rgba
impl RefUnwindSafe for Rgba
impl Send for Rgba
impl Sync for Rgba
impl Unpin for Rgba
impl UnsafeUnpin for Rgba
impl UnwindSafe for Rgba
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.