Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tacanvas.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-08-12 21:42:43 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-08-12 21:42:43 (GMT)
commit26355ab5b517d65d87cfcb239fca5365ec49cd49 (patch)
treee19a296fc80853e9f9c39188358a373700169456 /TurtleArt/tacanvas.py
parent2ff0792593756759828816b9e1608248f920f2af (diff)
added read-pixel method
Diffstat (limited to 'TurtleArt/tacanvas.py')
-rw-r--r--TurtleArt/tacanvas.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py
index 03f69fc..30431a7 100644
--- a/TurtleArt/tacanvas.py
+++ b/TurtleArt/tacanvas.py
@@ -566,6 +566,13 @@ class TurtleGraphics:
int(w), int(h)),
False)
+ def read_pixel(self, x, y):
+ """ Read the pixel at x, y """
+ if self.tw.interactive_mode:
+ return self.canvas.get_pixel((x, y))
+ else:
+ return(-1, -1, -1, -1)
+
def set_turtle(self, k, colors=None):
""" Select the current turtle and associated pen status """
if not self.tw.turtles.dict.has_key(k):