prepend parsed hex colors with '#'

This commit is contained in:
Daniel Sommer 2023-11-21 12:33:49 +01:00
parent 32f638f6aa
commit 65aa2e5e64

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", uint8(r>>8), uint8(g>>8), uint8(b>>8))
return fmt.Sprintf("#%02x%02x%02x", uint8(r>>8), uint8(g>>8), uint8(b>>8))
}