Rework dict with color data to use color enum
This commit is contained in:
@@ -18,16 +18,21 @@
|
||||
# =============================================================================
|
||||
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
from service.const import Color
|
||||
|
||||
|
||||
# In HSL format
|
||||
BASE_COLORS = (
|
||||
(0 / 360.0, 1.0, 0.5, 'Red'),
|
||||
(120 / 360.0, 1.0, 0.5, 'Green'),
|
||||
(240 / 360.0, 1.0, 0.5, 'Blue'),
|
||||
(56 / 360.0, 1.0, 0.5, 'Yellow'),
|
||||
(180 / 360.0, 1.0, 0.5, 'Cyan'),
|
||||
(300 / 360.0, 1.0, 0.5, 'Magenta'),
|
||||
(40 / 360.0, 1.0, 0.5, 'Orange'),
|
||||
(275 / 360.0, 1.0, 0.5, 'Purple'))
|
||||
BASE_COLORS = OrderedDict([
|
||||
(Color.red, (0 / 360.0, 1.0, 0.5, 'color_red')),
|
||||
(Color.green, (120 / 360.0, 1.0, 0.5, 'color_green')),
|
||||
(Color.blue, (240 / 360.0, 1.0, 0.5, 'color_blue')),
|
||||
(Color.yellow, (56 / 360.0, 1.0, 0.5, 'color_yellow')),
|
||||
(Color.cyan, (180 / 360.0, 1.0, 0.5, 'color_cyan')),
|
||||
(Color.magenta, (300 / 360.0, 1.0, 0.5, 'color_magenta')),
|
||||
(Color.orange, (40 / 360.0, 1.0, 0.5, 'color_orange')),
|
||||
(Color.purple, (275 / 360.0, 1.0, 0.5, 'color_purple'))])
|
||||
|
||||
|
||||
def hsl_to_hsv(hsl):
|
||||
|
||||
@@ -138,3 +138,14 @@ class TargetResistMode(IntEnum):
|
||||
armor = autoId()
|
||||
hull = autoId()
|
||||
weightedAverage = autoId()
|
||||
|
||||
@unique
|
||||
class Color(IntEnum):
|
||||
red = autoId()
|
||||
green = autoId()
|
||||
blue = autoId()
|
||||
yellow = autoId()
|
||||
cyan = autoId()
|
||||
magenta = autoId()
|
||||
orange = autoId()
|
||||
purple = autoId()
|
||||
|
||||
Reference in New Issue
Block a user