Struct mutils::Colour[][src]

pub struct Colour { /* fields omitted */ }

Implementations

impl Colour[src]

pub const WHITE: Colour[src]

pub const BLACK: Colour[src]

pub const MAGENTA: Colour[src]

pub const CYAN: Colour[src]

pub const YELLOW: Colour[src]

pub fn new_from_f32s(red: f32, green: f32, blue: f32, alpha: f32) -> Self[src]

pub const fn new_from_u32s(red: u32, green: u32, blue: u32, alpha: u32) -> Self[src]

pub const fn new_from_u8s(red: u8, green: u8, blue: u8, alpha: u8) -> Self[src]

pub const fn new_from_rgba(rgba: u32) -> Self[src]

pub fn red_f32(&self) -> f32[src]

pub fn red_u32(&self) -> u32[src]

pub fn red_u8(&self) -> u8[src]

pub fn green_f32(&self) -> f32[src]

pub fn green_u32(&self) -> u32[src]

pub fn green_u8(&self) -> u8[src]

pub fn blue_f32(&self) -> f32[src]

pub fn blue_u32(&self) -> u32[src]

pub fn blue_u8(&self) -> u8[src]

pub fn alpha_f32(&self) -> f32[src]

pub fn alpha_u32(&self) -> u32[src]

pub fn alpha_u8(&self) -> u8[src]

pub fn mix(self, other: Self, amount: f32) -> Self[src]

pub fn mix_no_alpha(self, other: Self, amount: f32) -> Self[src]

pub fn to_rgba_u32(self) -> u32[src]

Trait Implementations

impl Add<Colour> for Colour[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, other: Self) -> Self[src]

Performs the + operation. Read more

impl AddAssign<Colour> for Colour[src]

fn add_assign(&mut self, other: Self)[src]

Performs the += operation. Read more

impl Clone for Colour[src]

fn clone(&self) -> Colour[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Colour[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Div<Colour> for Colour[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, other: Self) -> Self[src]

Performs the / operation. Read more

impl Div<f32> for Colour[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, val: f32) -> Self[src]

Performs the / operation. Read more

impl DivAssign<Colour> for Colour[src]

fn div_assign(&mut self, other: Self)[src]

Performs the /= operation. Read more

impl DivAssign<f32> for Colour[src]

fn div_assign(&mut self, val: f32)[src]

Performs the /= operation. Read more

impl Mul<Colour> for Colour[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, other: Self) -> Self[src]

Performs the * operation. Read more

impl Mul<f32> for Colour[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, val: f32) -> Self[src]

Performs the * operation. Read more

impl MulAssign<Colour> for Colour[src]

fn mul_assign(&mut self, other: Self)[src]

Performs the *= operation. Read more

impl MulAssign<f32> for Colour[src]

fn mul_assign(&mut self, val: f32)[src]

Performs the *= operation. Read more

impl PartialEq<Colour> for Colour[src]

fn eq(&self, other: &Colour) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Colour) -> bool[src]

This method tests for !=.

impl Rem<Colour> for Colour[src]

type Output = Self

The resulting type after applying the % operator.

fn rem(self, other: Self) -> Self[src]

Performs the % operation. Read more

impl Sub<Colour> for Colour[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, other: Self) -> Self[src]

Performs the - operation. Read more

impl SubAssign<Colour> for Colour[src]

fn sub_assign(&mut self, other: Self)[src]

Performs the -= operation. Read more

impl Copy for Colour[src]

impl StructuralPartialEq for Colour[src]

Auto Trait Implementations

impl RefUnwindSafe for Colour

impl Send for Colour

impl Sync for Colour

impl Unpin for Colour

impl UnwindSafe for Colour

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]