Skip to content

Bug or user error? #253

Answered by Ogeon
Algorab asked this question in Q&A
Aug 3, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

It looks to me like it's just a matter of using different scales (there are multiple conventions). The ranges of RGB, saturation and lightness is 0.0 to 1.0 when using f32 and f64. So if I'm reading this correctly, saturation should be 1.0, lightness should be 0.5 and the expected RGB values either changed from 255.0 to 1.0 or converted to u8 with some variant of rgb.into_format::<u8>().

You can check the documentation for the ranges of each color space.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Algorab
Comment options

Answer selected by Ogeon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants