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

Function GetSuitable

gui/utils/color.py:45–57  ·  view source on GitHub ↗

Calculates a suitable color based on original color (wx.Colour), its brightness, and a factor (darken/brighten by factor depending on calculated brightness)

(color, factor: [0, 1])

Source from the content-addressed store, hash-verified

43
44
45def GetSuitable(color, factor: [0, 1]):
46 """
47 Calculates a suitable color based on original color (wx.Colour), its
48 brightness, and a factor (darken/brighten by factor depending on
49 calculated brightness)
50 """
51
52 brightness = _getBrightness(color)
53
54 if brightness > 129:
55 return Darken(color, factor)
56 else:
57 return Brighten(color, factor)
58
59
60def CalculateTransition(s_color, e_color, delta):

Callers

nothing calls this directly

Calls 3

_getBrightnessFunction · 0.85
DarkenFunction · 0.85
BrightenFunction · 0.85

Tested by

no test coverage detected