[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
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Color, unpacking to r,g,b and r,g,b,a - ValueError: too many values to unpack
- From: René Dudfield <renesd@xxxxxxxxx>
- Date: Wed, 17 Jun 2009 15:02:38 +1000
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 17 Jun 2009 01:02:41 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=7mpiexvlAU+Unh3erc0vJ+CwyOWGjxlEvOkypNoI2H0=; b=QOf7+G23YW5y4gOPiBADXTksWweOG57tTUilgoZCW4PxssuNSeC72bGQQCow7HdTOu PoKngs2hDtcOTLuUSUVzq6J1uV83W3ngQA4+6Ky/zducAKrC+r4xgntfvqdo8B/VzjWd mylxyeLGc+tEyj0RHWQna6jEtepPzQlj7Daoo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=o+e7HEfgtN3rpzlhwwQIPq9RYdNMUUjMXSRX3L5NdoVMSlNZIIKqRQ1UrMr2Az597p fPUPWK9w+ZMNTxw3+uvG6LGdLhqllDAMNaeC4ewcJj9jhiiPBreOpgkMqXRBXLY50AXQ z8IcYs9cX+KMZo/1+cOd+eV59fvbM9GuMW8ow=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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,
- Prev by Author:
Re: [pygame] [patch] minor memory leaks in color.c, font.c, mask.c and pixelarray.c
- Next by Author:
Re: [pygame] Color, unpacking to r,g,b and r,g,b,a - ValueError: too many values to unpack
- Previous by thread:
[pygame] Using sdl_surface for the movie module
- Next by thread:
Re: [pygame] Color, unpacking to r,g,b and r,g,b,a - ValueError: too many values to unpack
- Index(es):