MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / LineStyleData

Class LineStyleData

graphs/style.py:33–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32
33class LineStyleData:
34
35 def __init__(self, name, iconNamePrefix, mplSpec):
36 self.name = name
37 self._iconNamePrefix = iconNamePrefix
38 self.mplSpec = mplSpec
39
40 @property
41 def iconName(self):
42 # Get lightness out of RGB color, see following link for math:
43 # https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/
44 r, g, b, a = (c / 255 for c in wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
45 l = (max(r, g, b) + min (r, g, b)) / 2
46 suffix = '_black' if l > 0.3 else '_white'
47 return '{}{}'.format(self._iconNamePrefix, suffix)
48
49
50# In HSL format

Callers 1

style.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected