Struct orbtk::Color
[−]
#[repr(packed)]pub struct Color { pub data: u32, }
A color
Fields
data: u32
Methods
impl Color
const fn rgb(r: u8, g: u8, b: u8) -> Color
Create a new color from RGB
const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Color
Set the alpha
fn r(&self) -> u8
Get the r value
fn g(&self) -> u8
Get the g value
fn b(&self) -> u8
Get the b value
fn a(&self) -> u8
Get the alpha value
fn interpolate(start_color: Color, end_color: Color, scale: f64) -> Color
Interpolate between two colors
Trait Implementations
impl Clone for Color
fn clone(&self) -> Color
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more