Skip to main content

Color

Trait Color 

Source
pub trait Color {
    // Required methods
    fn rgb(&self) -> (u8, u8, u8);
    fn alpha(&self) -> f64;
}
Expand description

Any color representation

Required Methods§

Source

fn rgb(&self) -> (u8, u8, u8)

Convert the RGB representation to the standard RGB tuple

Source

fn alpha(&self) -> f64

Get the alpha channel of the color

Trait Implementations§

Source§

impl Color for Box<&dyn Color>

Source§

fn rgb(&self) -> (u8, u8, u8)

Convert the RGB representation to the standard RGB tuple
Source§

fn alpha(&self) -> f64

Get the alpha channel of the color

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Color for Box<&dyn Color>

Source§

fn rgb(&self) -> (u8, u8, u8)

Source§

fn alpha(&self) -> f64

Implementors§