[−][src]Struct brutils::Color
Color structure, values are stored as floats (f32)
Fields
r: f32
g: f32
b: f32
a: f32
Methods
impl Color
[src]
pub fn new(r: f32, g: f32, b: f32, a: f32) -> Self
[src]
pub fn new_255(r: u8, g: u8, b: u8, a: u8) -> Self
[src]
pub fn set(&mut self, r: f32, g: f32, b: f32, a: f32)
[src]
pub fn set_255(&mut self, r: u8, g: u8, b: u8, a: u8)
[src]
pub fn get_r(&self) -> u8
[src]
pub fn get_g(&self) -> u8
[src]
pub fn get_b(&self) -> u8
[src]
pub fn get_a(&self) -> u8
[src]
pub fn premultiply_aplha(&mut self)
[src]
pub fn lerp(&mut self, target: &Color, t: f32)
[src]
pub fn clamp(&mut self)
[src]
pub fn copy(&self) -> Self
[src]
pub fn add(&mut self, other: &Color)
[src]
pub fn subtract(&mut self, other: &Color)
[src]
pub fn multiply(&mut self, other: &Color)
[src]
pub fn divide(&mut self, other: &Color)
[src]
pub fn equals(&self, other: &Color) -> bool
[src]
pub fn clear() -> Self
[src]
pub fn black() -> Self
[src]
pub fn white() -> Self
[src]
pub fn red() -> Self
[src]
pub fn green() -> Self
[src]
pub fn blue() -> Self
[src]
pub fn cyan() -> Self
[src]
pub fn yellow() -> Self
[src]
pub fn magenta() -> Self
[src]
Trait Implementations
impl Default for Color
[src]
impl Clone for Color
[src]
fn clone(&self) -> Color
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Color
[src]
impl Debug for Color
[src]
impl Display for Color
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,