From 0417bd0f7ae460c25c15321e7b4cd96addfc580e Mon Sep 17 00:00:00 2001 From: Marion Date: Thu, 15 Aug 2013 12:14:11 +0000 Subject: use float() instead of int() to convert Colors to numbers --- 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={}, -- cgit v0.9.1