fixed parsing color values to hex

This commit is contained in:
Daniel Sommer 2023-11-21 11:01:01 +01:00
parent 4357ef154e
commit 32f638f6aa

View file

@ -65,5 +65,5 @@ func getColorPalette(image string, amount int) ([]color.Color, error) {
// parse rgb color values to hex
func rgbToHex(color color.Color) string {
r, g, b, _ := color.RGBA()
return fmt.Sprintf("#%02x%02x%02x", r, g, b)
return fmt.Sprintf("%02x%02x%02x", uint8(r>>8), uint8(g>>8), uint8(b>>8))
}