(self, args)
PALETTE: assign colour to attribute.
PALETTE: assign colour to attribute.
PALETTE : assign colour to attribute .
def palette_(self, args):
        """PALETTE: assign colour to attribute."""
        attrib = next(args)
        if attrib is not None:
            attrib = values.to_int(attrib)
        colour = next(args)
        if colour is not None:
            colour = values.to_int(colour)
        list(args)
        # wait a tick to make colour cycling loops work
        self._queues.wait()
        if attrib is None and colour is None:
            self.colourmap.set_all(self.colourmap.default_palette)
        else:
            # can't set blinking colours separately
            error.range_check(0, self.colourmap.num_palette-1, attrib)
            # numbers 255 and up are in fact allowed, 255 -> -1, 256 -> 0, etc
            colour = -1 + (colour + 1) % 256
            error.range_check(-1, self.colourmap.num_colours-1, colour)
            if colour != -1:
                self.colourmap.set_entry(attrib, colour)
def palette_ ( self , args ) : attrib = next ( args ) if attrib is not None : attrib = values . to_int ( attrib ) colour = next ( args ) if colour is not None : colour = values . to_int ( colour ) list ( args ) # wait a tick to make colour cycling loops work self . _queues . wait ( ) if attrib is None and colour is None : self . colourmap . set_all ( self . colourmap . default_palette ) else : # can't set blinking colours separately error . range_check ( 0 , self . colourmap . num_palette - 1 , attrib ) # numbers 255 and up are in fact allowed, 255 -> -1, 256 -> 0, etc colour = - 1 + ( colour + 1 ) % 256 error . range_check ( - 1 , self . colourmap . num_colours - 1 , colour ) if colour != - 1 : self . colourmap . set_entry ( attrib , colour )