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

[pygame] easy way to check pygame.Color() equality?



How do I check for color equality?

>>> r = pygame.Color("red")
>>> r == pygame.Color("red")
returns False # expected True, since I don't care if they are the same instance of a Color() class

I thought it would be an equality test., like this: [ The print out has equivalent values. ]

def ceq(c1,c2):
    return c1.r == c2.r and c1.g == c2.g and c1.b == c2.b and c1.a == c2.a
--
Jake