Trait ToHex

Source
pub trait ToHex {
    // Required methods
    fn as_hex(&self) -> String;
    fn to_hex_string(&self) -> String;
}
Expand description

Implement the ToHex trait

Provides interfaces for functions to display hex versions of RGB colours

An implementation is provided for Rgb<u8>

Required Methods§

Source

fn as_hex(&self) -> String

Return the colour code as an uppercase hex string with a # prefix

Source

fn to_hex_string(&self) -> String

Return the colour code as a lowercase hex string with no prefix

Implementations on Foreign Types§

Source§

impl ToHex for Rgb<u8>

Implementors§