Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/tablock.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/TurtleArt/tablock.py b/TurtleArt/tablock.py
index a0c0c2e..4015029 100644
--- a/TurtleArt/tablock.py
+++ b/TurtleArt/tablock.py
@@ -128,6 +128,7 @@ class Block:
self.shapes = [None, None]
self.name = name
self.colors = colors
+ self._custom_colors = False
self.scale = scale
self.docks = None
self.connections = None
@@ -281,6 +282,11 @@ class Block:
self.refresh()
self.spr.inval()
+ def set_colors(self, colors):
+ self.colors = colors[:]
+ self._custom_colors = True
+ self.refresh()
+
def refresh(self):
if self.spr is None:
return
@@ -487,6 +493,9 @@ class Block:
self.block_methods['basic-style'](svg)
def _set_colors(self, svg):
+ if self._custom_colors:
+ self.svg.set_colors(self.colors)
+ return
if self.name in BOX_COLORS:
self.colors = BOX_COLORS[self.name]
elif self.name in special_block_colors: