-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolours.py
40 lines (33 loc) · 934 Bytes
/
colours.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from __future__ import annotations
from enum import Enum, auto
class Colour(Enum):
DARK_BLUE = auto()
LIGHT_BLUE = auto()
BROWN = auto()
DARK_GREEN = auto()
LIGHT_GREEN = auto()
NEON_GREEN = auto()
GREY = auto()
ORANGE = auto()
PINK = auto()
PURPLE = auto()
RED = auto()
YELLOW = auto()
__colour_codes__ = {
DARK_BLUE: 'DBLU',
LIGHT_BLUE: 'LBLU',
BROWN: 'BRWN',
DARK_GREEN: 'DGRN',
LIGHT_GREEN: 'LGRN',
NEON_GREEN: 'NGRN',
GREY: 'GRAY',
ORANGE: 'ORNG',
PINK: 'PINK',
PURPLE: 'PURP',
RED: 'RED ',
YELLOW: 'YLLW',
}
def __repr__(self) -> str:
return self.__colour_codes__[self.value]
def __lt__(self, other: Colour) -> bool:
return self.value < other.value