fromColor
Parameters
- c:Color
- Color
Source
Implementation
pub fn fromColor(c: Color) HSLuv {
var ret: HSLuv = undefined;
hsluv.rgb2hsluv(
@as(f32, c.r) / 255.0,
@as(f32, c.g) / 255.0,
@as(f32, c.b) / 255.0,
&ret.h,
&ret.s,
&ret.l,
);
ret.a = @as(f32, c.a) * 100.0 / 255.0;
return ret;
}