Trait Color

Source
pub trait Color {
    // Required methods
    fn r(&self) -> u8;
    fn g(&self) -> u8;
    fn b(&self) -> u8;
    fn a(&self) -> u8;
    fn rgb(&self) -> [u8; 3];
    fn rgba(&self) -> [u8; 4];
    fn hex(&self) -> String;
    fn hexa(&self) -> String;
    fn paint(&self, text: &str) -> String;
    fn compare(&self, other: &Rgba<u8>) -> Ordering;
}

Required Methods§

Source

fn r(&self) -> u8

Source

fn g(&self) -> u8

Source

fn b(&self) -> u8

Source

fn a(&self) -> u8

Source

fn rgb(&self) -> [u8; 3]

Source

fn rgba(&self) -> [u8; 4]

Source

fn hex(&self) -> String

Source

fn hexa(&self) -> String

Source

fn paint(&self, text: &str) -> String

Source

fn compare(&self, other: &Rgba<u8>) -> Ordering

Implementations on Foreign Types§

Source§

impl Color for Rgba<u8>

Source§

fn r(&self) -> u8

Source§

fn g(&self) -> u8

Source§

fn b(&self) -> u8

Source§

fn a(&self) -> u8

Source§

fn rgb(&self) -> [u8; 3]

Source§

fn rgba(&self) -> [u8; 4]

Source§

fn hex(&self) -> String

Source§

fn hexa(&self) -> String

Source§

fn paint(&self, text: &str) -> String

Source§

fn compare(&self, other: &Rgba<u8>) -> Ordering

Implementors§