use glam::f64::DVec3;
use crate::color::Color;
pub trait ColorVecSpace {
type Vector: Sized;
}
pub trait OpponentSpace: ColorVecSpace {
fn from_lxy(lxy: DVec3) -> Color<Self>;
fn into_lxy(clr: Color<Self>) -> DVec3;
}
#[derive(Debug)]
pub struct Ciexyz;
#[derive(Debug)]
pub struct LinearSrgb;
#[derive(Debug)]
pub struct Oklab;
#[derive(Debug)]
pub struct Srgb;
#[derive(Debug)]
pub struct Srlab2;
impl ColorVecSpace for Ciexyz {
type Vector = DVec3;
}
impl ColorVecSpace for LinearSrgb {
type Vector = DVec3;
}
impl ColorVecSpace for Oklab {
type Vector = DVec3;
}
impl OpponentSpace for Oklab {
fn from_lxy(lxy: DVec3) -> Color<Self> { Color::new(lxy) }
fn into_lxy(clr: Color<Self>) -> DVec3 { clr.into_inner() }
}
impl ColorVecSpace for Srgb {
type Vector = DVec3;
}