Open martinzuern opened 5 years ago
Color white is represented in HSV and HSL as [0 0 1] (as per https://en.wikipedia.org/wiki/HSL_and_HSV#Examples)
[0 0 1]
While rgb->hsv works perfectly fine, hsv->rgb (and hsl->rgb) return for white [1 1 1] instead of [255 255 255].
rgb->hsv
hsv->rgb
hsl->rgb
[1 1 1]
[255 255 255]
[1:0]~shadow.user=> (use 'inkspot.converter) nil [1:0]~shadow.user=> (rgb->hsv [255 255 255]) [0.0 0.0 1.0] [1:0]~shadow.user=> (hsv->rgb [0 0 1]) #object[java.awt.Color 0x70c88923 "java.awt.Color[r=1,g=1,b=1]"] [1:0]~shadow.user=> (hsv->rgb [0.0 0.0 1.0]) #object[java.awt.Color 0x15f63744 "java.awt.Color[r=1,g=1,b=1]"] [1:0]~shadow.user=>
I think it's due to this line: https://github.com/rm-hull/inkspot/blob/ccb7a452a0930f451bcc6c960024d6029f616cd2/src/inkspot/converter.cljc#L29-L31
Yes, I think you are correct.
Color white is represented in HSV and HSL as
[0 0 1]
(as per https://en.wikipedia.org/wiki/HSL_and_HSV#Examples)While
rgb->hsv
works perfectly fine,hsv->rgb
(andhsl->rgb
) return for white[1 1 1]
instead of[255 255 255]
.I think it's due to this line: https://github.com/rm-hull/inkspot/blob/ccb7a452a0930f451bcc6c960024d6029f616cd2/src/inkspot/converter.cljc#L29-L31