[−][src]Enum piet::Color
A datatype representing color.
Currently this is only a 32 bit RGBA value, but it will likely extend to some form of wide-gamut colorspace, and in the meantime is useful for giving programs proper type.
Variants
Rgba32(u32)
Methods
impl Color
[src]
pub const fn rgba32(rgba: u32) -> Color
[src]
Create a color from a 32-bit rgba value (alpha as least significant byte).
pub const fn rgb24(rgb: u32) -> Color
[src]
Create a color from a 24-bit rgb value (red most significant, blue least).
pub fn rgba<F: Into<f64>>(r: F, g: F, b: F, a: F) -> Color
[src]
Create a color from four floating point values, each in the range 0.0 to 1.0.
The interpretation is the same as rgba32, and no greater precision is (currently) assumed.
pub fn rgb<F: Into<f64>>(r: F, g: F, b: F) -> Color
[src]
Create a color from three floating point values, each in the range 0.0 to 1.0.
The interpretation is the same as rgb24, and no greater precision is (currently) assumed.
pub fn as_rgba32(&self) -> u32
[src]
Convert a color value to a 32-bit rgba value.
pub const WHITE: Color
[src]
Opaque white.
pub const BLACK: Color
[src]
Opaque black.
Trait Implementations
Auto Trait Implementations
impl Sync for Color
impl Unpin for Color
impl Send for Color
impl UnwindSafe for Color
impl RefUnwindSafe for Color
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,