Colored

Trait Colored 

Source
pub trait Colored: Sized {
    // Required methods
    fn color(&self) -> u32;
    fn from_color(color: u32) -> Option<Self>;

    // Provided methods
    fn color_string(&self) -> String { ... }
    fn from_color_str<S: AsRef<str>>(color: S) -> Option<Self> { ... }
}
Expand description

Definitions which are associated with colors.

Required Methods§

Source

fn color(&self) -> u32

Gets the color.

Source

fn from_color(color: u32) -> Option<Self>

Attempts to convert a hexadecimal color.

Provided Methods§

Source

fn color_string(&self) -> String

Converts this into a hexademical color string in the format “#FFFFFF”.

Source

fn from_color_str<S: AsRef<str>>(color: S) -> Option<Self>

Attempts to convert a hexadecimal color string.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§