summaryrefslogtreecommitdiff
path: root/engine/src/color.rs
blob: 697ea8b77d3861774cfedcb4bcd26227e0f2b425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#[derive(Debug, Clone, Default)]
#[repr(C)]
pub struct Color<Value>
{
    pub red: Value,
    pub green: Value,
    pub blue: Value,
}

impl Color<f32>
{
    pub const WHITE_F32: Self = Self { red: 1.0, green: 1.0, blue: 1.0 };
}

impl<Value: Clone> From<Value> for Color<Value>
{
    fn from(value: Value) -> Self
    {
        Self {
            red: value.clone(),
            green: value.clone(),
            blue: value,
        }
    }
}