1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use super::*;
use palette::{Srgb, Srgba};
use std::marker::PhantomData;
mod builtin;
mod convert;
mod display;
mod serder;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct Color(Srgba<u8>);
impl Color {
pub const fn new(red: u8, green: u8, blue: u8, alpha: u8) -> Self {
Self(Srgba { color: Srgb { red, green, blue, standard: PhantomData }, alpha })
}
#[inline(always)]
pub const fn view(&self) -> (u8, u8, u8, u8) {
(self.0.color.red, self.0.color.green, self.0.color.blue, self.0.alpha)
}
}