MCPcopy Create free account
hub / github.com/ActiveState/code / setColor

Method setColor

recipes/Python/580811_Uno_TextBased/recipe-580811.py:659–681  ·  view source on GitHub ↗

Sets Card's color and escape code.

(self, color)

Source from the content-addressed store, hash-verified

657 ### -\/- Set Card Information -\/- ###
658
659 def setColor(self, color):
660 '''Sets Card's color and escape code.'''
661 if color == 'blue':
662 self.color = 'blue'
663 self.colorCode = self.colors['blue']
664 self.colorCodeDark = self.colors['dblue']
665 elif color == 'red':
666 self.color = 'red'
667 self.colorCode = self.colors['red']
668 self.colorCodeDark = self.colors['dred']
669 elif color == 'yellow':
670 self.color = 'yellow'
671 self.colorCode = self.colors['yellow']
672 self.colorCodeDark = self.colors['dyellow']
673 elif color == 'green':
674 self.color = 'green'
675 self.colorCode = self.colors['green']
676 self.colorCodeDark = self.colors['dgreen']
677 elif color == 'wild': #No color modification
678 self.wild = True
679 self.color = 'wild'
680 self.colorCodeDark = self.colors['dwild']
681 self.colorCode = self.colors['wild']
682
683 def setValue(self, value):
684 if value in ('0','1','2','3','4','5','6','7','8','9','X','R','+2','+4','W'):

Callers 3

__init__Method · 0.95
changeColorMethod · 0.95
paintMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected