+COLOURS_NAMED = dict(list(zip(
+ ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'],
+ [str(x) for x in range(30, 38)]
+)))
+COLOURS_MIDS = [
+ colour for name, colour in list(COLOURS_NAMED.items())
+ if name not in ('black', 'white')
+]
+
+class AnsiColourException(Exception):
+ ''' Exception while processing ansi colours '''
+ pass