|
|
@ -245,13 +245,13 @@ func getMessageColors(badgeColor string) (string, string) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// parseColor parses hex color
|
|
|
|
// parseColor parses hex color
|
|
|
|
func parseColor(c string) int {
|
|
|
|
func parseColor(c string) int64 {
|
|
|
|
i, _ := strconv.ParseInt(c, 16, 64)
|
|
|
|
i, _ := strconv.ParseInt(c, 16, 32)
|
|
|
|
return int(i)
|
|
|
|
return i
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// calcLuminance calculates relative luminance
|
|
|
|
// calcLuminance calculates relative luminance
|
|
|
|
func calcLuminance(color int) float64 {
|
|
|
|
func calcLuminance(color int64) float64 {
|
|
|
|
r := calcLumColor(float64(color>>16&0xFF) / 255)
|
|
|
|
r := calcLumColor(float64(color>>16&0xFF) / 255)
|
|
|
|
g := calcLumColor(float64(color>>8&0xFF) / 255)
|
|
|
|
g := calcLumColor(float64(color>>8&0xFF) / 255)
|
|
|
|
b := calcLumColor(float64(color&0xFF) / 255)
|
|
|
|
b := calcLumColor(float64(color&0xFF) / 255)
|
|
|
|