From bed29004c29c84f0e10c5f36796f7800661ab026 Mon Sep 17 00:00:00 2001 From: kris Date: Wed, 12 Jun 2019 22:12:26 +0100 Subject: [PATCH] Add a DHGRColours enum mapping the DHGR logical colours to their (memory-order) 4-bit values. --- transcoder/colours.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 transcoder/colours.py diff --git a/transcoder/colours.py b/transcoder/colours.py new file mode 100644 index 0000000..7def093 --- /dev/null +++ b/transcoder/colours.py @@ -0,0 +1,25 @@ +"""Apple II logical display colours.""" + +import enum + + +class DHGRColours(enum.Enum): + # Value is memory bit order, which is opposite to screen order (bits + # ordered Left to Right on screen) + BLACK = 0b0000 + MAGENTA = 0b1000 + BROWN = 0b0100 + ORANGE = 0b1100 + DARK_GREEN = 0b0010 + GREY1 = 0b1010 + GREEN = 0b0110 + YELLOW = 0b1110 + DARK_BLUE = 0b0001 + VIOLET = 0b1001 + GREY2 = 0b0101 + PINK = 0b1101 + MED_BLUE = 0b0011 + LIGHT_BLUE = 0b1011 + AQUA = 0b0111 + WHITE = 0b1111 +