MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / CalculateTransition

Function CalculateTransition

gui/utils/color.py:60–73  ·  view source on GitHub ↗

Calculates the color between a given start and end color using a delta value between 0 and 1

(s_color, e_color, delta)

Source from the content-addressed store, hash-verified

58
59
60def CalculateTransition(s_color, e_color, delta):
61 """
62 Calculates the color between a given start and end color using a delta
63 value between 0 and 1
64 """
65
66 sR, sG, sB, sA = s_color
67 eR, eG, eB, eA = e_color
68
69 tR = sR + (eR - sR) * delta
70 tG = sG + (eG - sG) * delta
71 tB = sB + (eB - sB) * delta
72
73 return wx.Colour(round(tR), round(tG), round(tB), round((sA + eA) / 2))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected