[][src]Struct hsl_ish::rgb::Rgb

pub struct Rgb {
    pub r: u8,
    pub g: u8,
    pub b: u8,


r: u8g: u8b: u8


impl Rgb[src]

pub fn new(r: u8, g: u8, b: u8) -> Self[src]

pub fn s_rgb(&self) -> [f64; 3][src]

Reduces RGB range of [0, 255] to sRGB range of [0.0, 1.0]

Trait Implementations

impl Debug for Rgb[src]

impl From<Hsl> for Rgb[src]

fn from(hsl: Hsl) -> Self[src]

Converts from the HSL to the RGB color space.


use hsl_ish::{Hsl, Rgb};
let hsl = Hsl::new(120.0, 1.0, 0.5);
let rgb = Rgb::from(hsl);
assert_eq!((rgb.r, rgb.g, rgb.b), (0, 255, 0));

Auto Trait Implementations

impl RefUnwindSafe for Rgb

impl Send for Rgb

impl Sync for Rgb

impl Unpin for Rgb

impl UnwindSafe for Rgb

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.