colorsys-go icon indicating copy to clipboard operation
colorsys-go copied to clipboard

Specific color conversion bug

Open somnus-L opened this issue 4 years ago • 0 comments

` //pink r 255,g 191, b 204 //crimson r 219, g 20, b 60 //magenta r 255, g 0, b 255 // blue r 0 g 0 b 255

h, s, _ := colorsys.Rgb2Hsv(r, g, b) s = s * 1000 fmt.Printf("rgbl(%v,%v,%v) => hsv(%x,%x)", r, g, b, uint(h), uint(s)) ` result: "rgbl(255,191,204,50) => hsv(fffffffffffffff4,fa)" "rgbl(219,20,60,50) => hsv(fffffffffffffff4,38c)" "rgbl(255,0,255,50) => hsv(ffffffffffffffc4,3e8)" "rgbl(0,0,255,50) => hsv(f0,3e8)"

Why do the above three colors appear like "fffff...." after conversion ?

somnus-L avatar Aug 26 '20 09:08 somnus-L