[][src]Struct brutils::Color

pub struct Color {
    pub r: f32,
    pub g: f32,
    pub b: f32,
    pub a: f32,
}

Color structure, values are stored as floats (f32)

Fields

r: f32g: f32b: f32a: 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_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

impl Send for Color

impl Sync for Color

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.

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

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

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