diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-09 21:07:49 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-09 21:07:49 (GMT) |
commit | e4252715ca37f55b2bd6702a6c2bb5ce55dd3e23 (patch) | |
tree | 61b41723b5ac5e74c53d92a8fb3113ccacfc23f3 /TurtleArt/tacanvas.py | |
parent | dbc9daecdc6894fe62c23a86aaa91a9513742c13 (diff) |
introduce a Color type for the pen color in block programs
Diffstat (limited to 'TurtleArt/tacanvas.py')
-rw-r--r-- | TurtleArt/tacanvas.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py index 89b8ed1..d3c4b3f 100644 --- a/TurtleArt/tacanvas.py +++ b/TurtleArt/tacanvas.py @@ -28,7 +28,7 @@ import cairo import pangocairo from tautils import get_path -from taconstants import COLORDICT, TMP_SVG_PATH +from taconstants import Color, TMP_SVG_PATH def wrap100(n): @@ -208,19 +208,19 @@ class TurtleGraphics: save_rgb = self._fgrgb[:] # Special case for color blocks - if color in COLORDICT: - if COLORDICT[color][0] is None: - self._shade = COLORDICT[color][1] + if isinstance(color, Color): + if color.color is None: + self._shade = color.shade else: - self._color = COLORDICT[color][0] + self._color = color.color else: self._color = color - if shade in COLORDICT: - self._shade = COLORDICT[shade][1] + if isinstance(shade, Color): + self._shade = shade.shade else: self._shade = shade - if gray in COLORDICT: - self._gray = COLORDICT[gray][2] + if isinstance(gray, Color): + self._gray = gray.gray else: self._gray = gray |