const-css-color 0.1.1

Css color parser at compile time
Documentation
1
2
3
4
5
6
7
8
use super::*;

impl From<RGBA32> for RGBA {
    fn from(rgba: RGBA32) -> Self {
        let rgba = rgba.normalized();
        Self { r: (rgba.r * 255.0) as u8, g: (rgba.g * 255.0) as u8, b: (rgba.b * 255.0) as u8, a: (rgba.a * 255.0) as u8 }
    }
}