[][src]Enum dither::prelude::CGA

pub enum CGA {
    Black,
    Blue,
    Green,
    Cyan,
    Red,
    Magenta,
    Brown,
    LightGray,
    Gray,
    LightBlue,
    LightGreen,
    LightCyan,
    LightRed,
    LightMagenta,
    Yellow,
    White,
}

Variants

BlackBlueGreenCyanRedMagentaBrownLightGrayGrayLightBlueLightGreenLightCyanLightRedLightMagentaYellowWhite

Methods

impl CGA[src]

pub fn quantize(RGB: RGB<f64>) -> (RGB<f64>, RGB<f64>)[src]

quantize a RGB triplet to the closest CGA color and error. this is a somewhat naive/ inefficient implementation; i'm sure I can do better.

impl CGA[src]

pub const COLORS: [CGA; 16][src]

pub fn to_hex(self) -> u32[src]

pub fn try_from_hex(hex: u32) -> Option<Self>[src]

Trait Implementations

impl Eq for CGA[src]

impl Clone for CGA[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Into<&'static str> for CGA[src]

impl Copy for CGA[src]

impl PartialEq<CGA> for CGA[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl From<CGA> for RGB<u8>[src]

impl From<CGA> for RGB<f64>[src]

impl Debug for CGA[src]

impl Display for CGA[src]

impl FromStr for CGA[src]

type Err = UnknownCGAColorError

The associated error which can be returned from parsing.

Auto Trait Implementations

impl Send for CGA

impl Sync for CGA

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.