(self, current_attr, fore, back, bord)
return fore, None
Helper function for COLOR statement in SCREEN 9.
Helper function for COLOR statement in SCREEN 9.
Helper function for COLOR statement in SCREEN 9 .
def color(self, current_attr, fore, back, bord):
        """Helper function for COLOR statement in SCREEN 9."""
        if fore is None:
            fore = current_attr
        if back is None:
            # graphics mode bg is always 0; sets palette instead
            back = self.get_entry(0)
        # for screens other than 1, no distinction between 3rd parm zero and not supplied
        bord = bord or 0
        error.range_check(0, 255, bord)
        max_attr = self.num_attr - 1
        max_colour = self.num_colours - 1
        error.range_check(1, max_attr, fore)
        error.range_check(0, max_colour, back)
        # all background colours are accessible
        self.set_entry(0, back, force=True)
        # set attr, don't change border
        return fore, None
def color ( self , current_attr , fore , back , bord ) : if fore is None : fore = current_attr if back is None : # graphics mode bg is always 0; sets palette instead back = self . get_entry ( 0 ) # for screens other than 1, no distinction between 3rd parm zero and not supplied bord = bord or 0 error . range_check ( 0 , 255 , bord ) max_attr = self . num_attr - 1 max_colour = self . num_colours - 1 error . range_check ( 1 , max_attr , fore ) error . range_check ( 0 , max_colour , back ) # all background colours are accessible self . set_entry ( 0 , back , force = True ) # set attr, don't change border return fore , None