Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/taturtle.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2013-10-30 15:23:09 (GMT)
committer Walter Bender <walter@sugarlabs.org>2013-10-30 15:23:09 (GMT)
commit32444889db2d7573426b3e93722a566b36385bc3 (patch)
treec58615892f29f64de1620e015e1152e2a1de7af5 /TurtleArt/taturtle.py
parent6484171158df453c6a89075b28a11f8f5f435beb (diff)
use new prim method for turtle see; fix after calls
Diffstat (limited to 'TurtleArt/taturtle.py')
-rw-r--r--TurtleArt/taturtle.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/TurtleArt/taturtle.py b/TurtleArt/taturtle.py
index abea538..88f4782 100644
--- a/TurtleArt/taturtle.py
+++ b/TurtleArt/taturtle.py
@@ -735,6 +735,19 @@ class Turtle:
round_int(w)]]))
self._turtles.turtle_window.send_event(event)
+ def read_pixel(self):
+ """ Read r, g, b, a from the canvas and push b, g, r to the stack """
+ r, g, b, a = self.get_pixel()
+ self._turtles.turtle_window.lc.heap.append(b)
+ self._turtles.turtle_window.lc.heap.append(g)
+ self._turtles.turtle_window.lc.heap.append(r)
+
+ def get_color_index(self):
+ r, g, b, a = self.get_pixel()
+ color_index = self._turtles.turtle_window.canvas.get_color_index(
+ r, g, b)
+ return color_index
+
def get_name(self):
return self._name