Struct webrender_api::ColorF
[−]
[src]
#[repr(C)]pub struct ColorF { pub r: f32, pub g: f32, pub b: f32, pub a: f32, }
Represents RGBA screen colors with floating point numbers.
All components must be between 0.0 and 1.0. An alpha value of 1.0 is opaque while 0.0 is fully transparent.
Fields
r: f32
g: f32
b: f32
a: f32
Methods
impl ColorF
[src]
pub fn new(r: f32, g: f32, b: f32, a: f32) -> ColorF
[src]
Constructs a new ColorF
from its components.
pub fn scale_rgb(&self, scale: f32) -> ColorF
[src]
Multiply the RGB channels (but not alpha) with a given factor.
pub fn to_array(&self) -> [f32; 4]
[src]
pub fn premultiplied(&self) -> PremultipliedColorF
[src]
Multiply the RGB components with the alpha channel.
Trait Implementations
impl Clone for ColorF
[src]
fn clone(&self) -> ColorF
[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 Copy for ColorF
[src]
impl Debug for ColorF
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for ColorF
[src]
fn eq(&self, __arg_0: &ColorF) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ColorF) -> bool
[src]
This method tests for !=
.