Struct crayon::utils::Color
[−]
[src]
pub struct Color(pub f32, pub f32, pub f32, pub f32);
A RGBA Color
. Each color component is a floating point value
with a range from 0 to 1.
Methods
impl Color
[src]
fn from_argb_u32(encoded: u32) -> Self
[src]
Creates Color
from a u32 encoded ARGB
.
fn from_abgr_u32(encoded: u32) -> Self
[src]
Creates Color
from a u32 encoded ABGR
.
fn grayscale(&self) -> f32
[src]
Returns the grayscale
representation of RGB values.
fn clip(&self) -> Color
[src]
Clip to [0.0, 1.0] range.
fn rgb(&self) -> [f32; 3]
[src]
Truncate alpha channel.
impl Color
[src]
fn white() -> Self
[src]
fn gray() -> Self
[src]
fn black() -> Self
[src]
fn red() -> Self
[src]
fn green() -> Self
[src]
fn blue() -> Self
[src]
fn cyan() -> Self
[src]
fn magenta() -> Self
[src]
fn yellow() -> Self
[src]
fn transparent() -> Self
[src]
Trait Implementations
impl Debug for Color
[src]
impl Default for Color
[src]
impl Copy for Color
[src]
impl Clone for Color
[src]
fn clone(&self) -> Color
[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 PartialEq for Color
[src]
fn eq(&self, __arg_0: &Color) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Color) -> bool
[src]
This method tests for !=
.