diff options
author | Walter Bender <walter@sugarlabs.org> | 2013-05-22 11:48:01 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2013-05-22 11:48:01 (GMT) |
commit | 69a6947cbb2768c1a23fd34f9834afa2390a2ea4 (patch) | |
tree | a31ee8d20a7ae60f439847fbd98fa47cbfac45c2 | |
parent | 833041cea08f8719f356bb450a8ed233f00b1329 (diff) |
more adjustments to export of color constants to Logo
-rw-r--r-- | TurtleArt/tabasics.py | 10 | ||||
-rw-r--r-- | TurtleArt/taconstants.py | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index 9a921b4..581457b 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -67,7 +67,7 @@ from gettext import gettext as _ from tapalette import (make_palette, define_logo_function) from talogo import (primitive_dictionary, logoerror) from tautils import (convert, chr_to_ord, round_int, strtype) -from taconstants import (LOGOCOLORDICT, COLORDICT, CONSTANTS) +from taconstants import (COLORDICT, CONSTANTS) def _color_to_num(c): @@ -1382,8 +1382,12 @@ variable')) def _make_constant(self, palette, block_name, label, constant): """ Factory for constant blocks """ - if constant in LOGOCOLORDICT: - value = str(LOGOCOLORDICT[constant]) + if constant in COLORDICT: + if COLORDICT[constant][0] is not None: + value = str(COLORDICT[constant][0]) + else: + # Black or White + value = '0 tasetshade %d' % (COLORDICT[constant][1]) else: value = constant palette.add_block(block_name, diff --git a/TurtleArt/taconstants.py b/TurtleArt/taconstants.py index 4961b24..6f48c30 100644 --- a/TurtleArt/taconstants.py +++ b/TurtleArt/taconstants.py @@ -92,11 +92,6 @@ COLORDICT = {'_black': [None, 0, 0], '_white': [None, 100, 0], '_cyan': [50, 50, 100], '_blue': [70, 50, 100], '_purple': [90, 50, 100]} -LOGOCOLORDICT = {'_black': 0, '_white': 1, '_red': 2, '_orange': 3, - '_yellow': 3, '_green': 4, '_cyan': 5, '_blue': 6, - '_purple': 7} - - # Blocks that are expandable EXPANDABLE_STYLE = ['boolean-style', 'compare-porch-style', 'compare-style', 'number-style-porch', 'number-style', 'basic-style-2arg', |