There is an average_color function in the transform module in Pygame SVN.
On Fri, Dec 26, 2008 at 9:44 PM, yanom @linuxmail.org
wrote:
> if you wanted to get the overall average color of a sprite, you would have to
> use a for loop to go through all the pixels and count the pixels of each
> col
if you wanted to get the overall average color of a sprite, you would have to
use a for loop to go through all the pixels and count the pixels of each color
or something
- Original Message -
> From: "Aaron Maupin"
> To: pygame-users@seul.org
> Subject: Re: [pygame] get coluor of a sprite
Gonzalo Castro wrote:
What function may I use to get the colour of a sprite?
Very easy. Use Surface.get_at((x, y)) where x and y equals the pixel in
the surface you want to check the color of.
http://www.pygame.org/docs/ref/surface.html#Surface.get_at
Hello everybody!
What function may I use to get the colour of a sprite? I'm not talking
about filling it with a colour, I'm talking about a function that
returns the colur of the sprite.
Thanks, and have a happy new year! :)
Lenard Lindstrom wrote:
Jake b wrote:
I wanted to use this to call pygame functions, ( I am not writing new
functions in this way )
(It would save code and make it clearer then typing out the two
members every time.)
'tuple()' seems to work this way :)
Since a euclid Vector supports the sl
Jake b wrote:
I wanted to use this to call pygame functions, ( I am not writing new
functions in this way )
(It would save code and make it clearer then typing out the two
members every time.)
'tuple()' seems to work this way :)
Since a euclid Vector supports the slice operator you can proba