diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f95d7e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Veradana.ttf diff --git a/badge.go b/badge.go index 3b353aa..5cd8e49 100644 --- a/badge.go +++ b/badge.go @@ -245,13 +245,13 @@ func getMessageColors(badgeColor string) (string, string) { } // parseColor parses hex color -func parseColor(c string) int { - i, _ := strconv.ParseInt(c, 16, 64) - return int(i) +func parseColor(c string) int64 { + i, _ := strconv.ParseInt(c, 16, 32) + return i } // calcLuminance calculates relative luminance -func calcLuminance(color int) float64 { +func calcLuminance(color int64) float64 { r := calcLumColor(float64(color>>16&0xFF) / 255) g := calcLumColor(float64(color>>8&0xFF) / 255) b := calcLumColor(float64(color&0xFF) / 255)