I'm drawing a bunch of rectangles to the siaply screen, and I'm wondering how I would go about reading the rgb color at a certain pixel location? For example, I want to get the color of the pixel at location 0,0 on the display screen, and it return the value [0,0,0] (or similar).
http://www.pygame.org/docs/ref/surface.html#Surface.get_at
Surface.get_at((x, y)): return Color
Return a copy of the RGBA Color value at the given pixel. If the Surface has no per pixel alpha, then the alpha value will always be 255 (opaque). If the pixel position is outside the area of the Surface an IndexError exception will be raised.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With