(self, queues, adapter, monitor, colorswitch)
Initialise colour map.
Initialise colour map.
Initialise colour map .
def __init__(self, queues, adapter, monitor, colorswitch):
        """Initialise colour map."""
        self._queues = queues
        if monitor in MONO_TINT:
            self._mono = monitor in MONO_TINT
            self._mono_tint = MONO_TINT[monitor]
        self.set_colorswitch(colorswitch)
        self._palette = list(self.default_palette)
        # policy on PALETTE changes
        # effective palette change is an error in CGA
        if adapter in ('cga', 'cga_old', 'mda', 'hercules', 'olivetti'):
            self._palette_change_policy = 'error'
        # ignore palette changes in Tandy/PCjr SCREEN 0
        elif adapter in ('tandy', 'pcjr') and self.num_attr == 256:
            self._palette_change_policy = 'deny'
        else:
            self._palette_change_policy = 'allow'
        self.submit()
def __init__ ( self , queues , adapter , monitor , colorswitch ) : self . _queues = queues if monitor in MONO_TINT : self . _mono = monitor in MONO_TINT self . _mono_tint = MONO_TINT [ monitor ] self . set_colorswitch ( colorswitch ) self . _palette = list ( self . default_palette ) # policy on PALETTE changes # effective palette change is an error in CGA if adapter in ( 'cga' , 'cga_old' , 'mda' , 'hercules' , 'olivetti' ) : self . _palette_change_policy = 'error' # ignore palette changes in Tandy/PCjr SCREEN 0 elif adapter in ( 'tandy' , 'pcjr' ) and self . num_attr == 256 : self . _palette_change_policy = 'deny' else : self . _palette_change_policy = 'allow' self . submit ( )