prepend parsed hex colors with '#'
This commit is contained in:
parent
32f638f6aa
commit
65aa2e5e64
1 changed files with 1 additions and 1 deletions
|
@ -65,5 +65,5 @@ func getColorPalette(image string, amount int) ([]color.Color, error) {
|
||||||
// parse rgb color values to hex
|
// parse rgb color values to hex
|
||||||
func rgbToHex(color color.Color) string {
|
func rgbToHex(color color.Color) string {
|
||||||
r, g, b, _ := color.RGBA()
|
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))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue