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

[pygame] Color, unpacking to r,g,b and r,g,b,a - ValueError: too many values to unpack



Hi,

one issue with the new Color type is unpacking to r,g,b or r,g,b,a.

In some places Color is assumed to return (r,g,b) and others
(r,g,b,a), and now many things return a Color rather than a tuple.

So I want to change Color to unpack to r,g,b,a or r,g,b.

r,g,b = pygame.Color(1,2,3,4)
r,g,b,a = pygame.Color(1,2,3,4)

Anyone have an idea how this can work?  Either in C or python?

This is to keep backwards compatibility.


cheers,