diff --git a/graphs/colors.py b/graphs/colors.py index 581febd49..bce19aade 100644 --- a/graphs/colors.py +++ b/graphs/colors.py @@ -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): diff --git a/service/const.py b/service/const.py index e86effbca..6262fc3e1 100644 --- a/service/const.py +++ b/service/const.py @@ -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()