palette/oklab/
alpha.rs
1use crate::alpha::Alpha;
2use crate::oklab::Oklab;
3
4pub type Oklaba<T = f32> = Alpha<Oklab<T>, T>;
6
7impl<T, A> Alpha<Oklab<T>, A> {
9 pub const fn new(l: T, a: T, b: T, alpha: A) -> Self {
11 Alpha {
12 color: Oklab::new(l, a, b),
13 alpha,
14 }
15 }
16
17 pub fn into_components(self) -> (T, T, T, A) {
19 (self.color.l, self.color.a, self.color.b, self.alpha)
20 }
21
22 pub fn from_components((l, a, b, alpha): (T, T, T, A)) -> Self {
24 Self::new(l, a, b, alpha)
25 }
26}