prisma 0.1.1

A color library for both simple and complex color manipulation, intending to be the go to rust color library for most tasks. It can handle conversion between a large number of color models, and can convert into the CIE device independent color spaces. Prisma tries to be easy to use while encouraging correct transformations, making mathematically correct conversions easy without knowing the whole field of color science.
Documentation
use crate::channel::{ColorChannel, PosNormalBoundedChannel, PosNormalChannelScalar};
use num_traits;

/// An xy value used as a primary in Rgb color spaces
#[derive(Clone, Debug, PartialEq)]
pub struct RgbPrimary<T> {
    /// The `x` value
    pub x: PosNormalBoundedChannel<T>,
    /// The `y` value
    pub y: PosNormalBoundedChannel<T>,
}

impl<T> RgbPrimary<T>
where
    T: PosNormalChannelScalar + num_traits::Float,
{
    /// Construct a new `RgbPrimary` from `x` and `y`
    pub fn new(x: T, y: T) -> Self {
        RgbPrimary {
            x: PosNormalBoundedChannel::new(x),
            y: PosNormalBoundedChannel::new(y),
        }
    }

    /// Return a tuple of `(x, y)`
    pub fn to_tuple(self) -> (T, T) {
        (self.x.0, self.y.0)
    }
}