feat: add support for gifs

This commit is contained in:
2021-11-11 10:42:26 +02:00
parent 9c87d76dd8
commit fae7b9fbd9
2 changed files with 5 additions and 3 deletions
+4 -3
View File
@@ -24,6 +24,7 @@ import (
"strconv"
"image/color"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
@@ -99,12 +100,12 @@ func GetProminentColor(data []byte) (string, color.Color, error) {
colorMap := calculateColorMap(img, width, height)
var maxColor color.Color
maxAmmount := 0
maxAmount := 0
for color, amount := range colorMap {
if amount > maxAmmount {
if amount > maxAmount {
maxColor = color
maxAmmount = amount
maxAmount = amount
}
}