From 26355ab5b517d65d87cfcb239fca5365ec49cd49 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 12 Aug 2010 21:42:43 +0000 Subject: added read-pixel method --- 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): -- cgit v0.9.1