Struct orbtk::Color
[−]
[src]
#[repr(packed)]pub struct Color { pub data: u32, }
A color
Fields
data: u32
Methods
impl Color
[src]
const fn rgb(r: u8, g: u8, b: u8) -> Color
[src]
Create a new color from RGB
const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Color
[src]
Set the alpha
fn r(&self) -> u8
[src]
Get the r value
fn g(&self) -> u8
[src]
Get the g value
fn b(&self) -> u8
[src]
Get the b value
fn a(&self) -> u8
[src]
Get the alpha value
fn interpolate(start_color: Color, end_color: Color, scale: f64) -> Color
[src]
Interpolate between two colors
Trait Implementations
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<Color> for Color
[src]
Compare two colors (Do not take care of alpha)
fn eq(&self, other: &Color) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.