color_space
color_space copied to clipboard
A LAB -> RGB conversion produces negative values?
Aren't RGB values supposed to be positive in the [0, 255] range only?
Consider this:
let lab = color_space::Lab::new(46.0, 0.0, -60.0);
let rgb = lab.to_rgb();
println!("RGB: {} {} {}", rgb.r, rgb.g, rgb.b);
This prints:
RGB: -263.1193150769503 115.19741519097205 210.19858655756587
The negative r
value seems wrong, no?
I think the correct converted value is this:
Was there supposed to be a zero-truncation happening when a component value goes negative in the ::to_rgb()
implementation?