Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarion <marion.zepf@gmail.com>2013-08-15 12:14:11 (GMT)
committer Marion <marion.zepf@gmail.com>2013-08-15 12:14:11 (GMT)
commit0417bd0f7ae460c25c15321e7b4cd96addfc580e (patch)
tree0b085d52955ecd3059f2c49694d4f8142e905ba0
parent6998299fef2fbe1585e170b6732737ddc981c7ea (diff)
use float() instead of int() to convert Colors to numbers
-rw-r--r--TurtleArt/taprimitive.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/TurtleArt/taprimitive.py b/TurtleArt/taprimitive.py
index ab6bfe9..b92f2cc 100644
--- a/TurtleArt/taprimitive.py
+++ b/TurtleArt/taprimitive.py
@@ -581,7 +581,7 @@ class Primitive(object):
2. Convert a string containing a number into a float.
3. Convert a single character to its ASCII integer value.
4. Extract the first element of a list and convert it to a number.
- 5. Convert a Color to an int.
+ 5. Convert a Color to a float.
Return None if the value cannot be converted to a number. """
# 1. number
if isinstance(value, (float, int, long, ast.Num)):
@@ -627,9 +627,9 @@ class Primitive(object):
return None
# 5. Color
elif isinstance(value, Color):
- converted = int(value)
+ converted = float(value)
if convert_to_ast:
- conversion_ast = ast.Call(func=ast.Name(id='int',
+ conversion_ast = ast.Call(func=ast.Name(id='float',
ctx=ast.Load),
args=[value_ast],
keywords={},