Struct orbclient::color::Color [−][src]
#[repr(packed)]pub struct Color { pub data: u32, }
A color
Fields
data: u32
Methods
impl Color
[src]
impl Color
pub const fn rgb(r: u8, g: u8, b: u8) -> Self
[src]
pub const fn rgb(r: u8, g: u8, b: u8) -> Self
Create a new color from RGB
pub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Self
[src]
pub const fn rgba(r: u8, g: u8, b: u8, a: u8) -> Self
Set the alpha
pub fn r(&self) -> u8
[src]
pub fn r(&self) -> u8
Get the r value
pub fn g(&self) -> u8
[src]
pub fn g(&self) -> u8
Get the g value
pub fn b(&self) -> u8
[src]
pub fn b(&self) -> u8
Get the b value
pub fn a(&self) -> u8
[src]
pub fn a(&self) -> u8
Get the alpha value
pub fn interpolate(start_color: Color, end_color: Color, scale: f64) -> Color
[src]
pub fn interpolate(start_color: Color, end_color: Color, scale: f64) -> Color
Interpolate between two colors
Trait Implementations
impl Copy for Color
[src]
impl Copy for Color
impl Clone for Color
[src]
impl Clone for Color
fn clone(&self) -> Color
[src]
fn clone(&self) -> Color
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl PartialEq for Color
[src]
impl PartialEq for Color
Compare two colors (Do not take care of alpha)
fn eq(&self, other: &Color) -> bool
[src]
fn eq(&self, other: &Color) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl Debug for Color
[src]
impl Debug for Color