diff options
author | Walter Bender <walter@sugarlabs.org> | 2010-08-12 21:42:43 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2010-08-12 21:42:43 (GMT) |
commit | 26355ab5b517d65d87cfcb239fca5365ec49cd49 (patch) | |
tree | e19a296fc80853e9f9c39188358a373700169456 | |
parent | 2ff0792593756759828816b9e1608248f920f2af (diff) |
added read-pixel method
-rw-r--r-- | TurtleArt/tacanvas.py | 7 |
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): |