Cast colors into ints before passing to wx

See #2391 for more info
This commit is contained in:
DarkPhoenix
2022-04-20 01:26:52 +04:00
parent a51fbbc238
commit e98ae5de39

View File

@@ -12,7 +12,7 @@ def Brighten(color, factor):
b += (255 - b) * factor
g += (255 - g) * factor
return wx.Colour(r, g, b, a)
return wx.Colour(round(r), round(g), round(b), round(a))
def Darken(color, factor):
@@ -30,7 +30,7 @@ def Darken(color, factor):
b = min(max(b, 0), 255)
g = min(max(g, 0), 255)
return wx.Colour(r, g, b, a)
return wx.Colour(round(r), round(g), round(b), round(a))
def _getBrightness(color):
@@ -70,4 +70,4 @@ def CalculateTransition(s_color, e_color, delta):
tG = sG + (eG - sG) * delta
tB = sB + (eB - sB) * delta
return wx.Colour(tR, tG, tB, (sA + eA) / 2)
return wx.Colour(round(tR), round(tG), round(tB), round((sA + eA) / 2))