def colorspaces_converted_should_equate_bar_rounding (self, prop):
for c in rgba_combos_Color_generator():
other = pygame.Color(0)
try:
setattr(other, prop, getattr(c, prop))
#eg other.hsla = c.hsla
self.assert_(abs(other.r - c.r) <= 1)
self.assert_(abs(other.b - c.b) <= 1)
self.assert_(abs(other.g - c.g) <= 1)
# CMY and I1I2I3 do not care about the alpha
if not prop in ("cmy", "i1i2i3"):
self.assert_(abs(other.a - c.a) <= 1)
except ValueError:
pass # other tests will notify, this tests equation
评论列表
文章目录