[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] using Color() with HSVA



On Fri, Jul 30, 2010 at 2:43 AM, Jake b <ninmonkeys@xxxxxxxxx> wrote:
> atm I have to use the cookbook to get RGB from HSV color.
>
> Docs say:
> Color.hsva
> Gets or sets the HSVA representation of the Color.
> Color.hsva: Return tuple
> This fails:
>>>> a2.hsva
> (220.0, 75.0, 1.5686274509803921, 1.9607843137254901)
>>>> a2.hsva(1,1,1,1)

That's not how you set other variables is it?
a = "hello world"
is the syntax I use, not
a("hello world")
the latter would be a function call, not a variable set.

Does it also fail when you do a2.hsva = (1,1,1,1) ?

Note your error message, "tuple object is not callable". That's
because hsva is a tuple and you're trying to call it as a function
with the parameter list (1,1,1,1), not reassigning it to (1,1,1,1).

most likely the hsva is a property and its set method is going to
transform it into the correct color representation behind the scenes.

-Luke