(self, current_attr, fore, back, bord)
return fore, None
Mode-dependent helper function for COLOR statement.
Mode-dependent helper function for COLOR statement.
Mode - dependent helper function for COLOR statement .
def color(self, current_attr, fore, back, bord):
        """Mode-dependent helper function for COLOR statement."""
        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)
        # in screen 7 and 8, only low intensity palette is used for background
        self.set_entry(0, back % 8, 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 ) # in screen 7 and 8, only low intensity palette is used for background self . set_entry ( 0 , back % 8 , force = True ) # set attr, don't change border return fore , None