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 fn rgba(r: f32, g: f32, b: f32, a: f32) -> Color
pub fn rgb(r: f32, g: f32, b: f32) -> Color
pub fn rgba_i(r: u8, g: u8, b: u8, a: u8) -> Color
pub fn rgb_i(r: u8, g: u8, b: u8) -> Color
pub fn lerp(self, c: Color, u: f32) -> Color
pub fn hsla(h: f32, s: f32, l: f32, a: f32) -> Color
pub fn hsl(h: f32, s: f32, l: f32) -> Color
Trait Implementations§
Source§impl<T: AsPrimitive<f32>> From<(T, T, T, T)> for Color
impl<T: AsPrimitive<f32>> From<(T, T, T, T)> for Color
Source§fn from((r, g, b, a): (T, T, T, T)) -> Self
fn from((r, g, b, a): (T, T, T, T)) -> Self
Converts to this type from the input type.
impl Copy for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more