ux-primitives 0.1.3

Graphics Primitives for Angular Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

// XYZ -> RGB
impl From<XyzColor> for RgbColor {
    fn from(xyz: XyzColor) -> RgbColor {
        match Result::<RgbColor, ColorError>::from(xyz) {
            Ok(rgb) => rgb,
            Err(err) => panic!("Converting XyzColor to RgbColor failed: {}", err),
        }
    }
}
impl From<XyzColor> for Result<RgbColor, ColorError> {
    fn from(_: XyzColor) -> Result<RgbColor, ColorError> {
        // TODO: implement L*a*b -> RGB
        Err(ColorError::Unimplemented)
    }
}