def test_color_mix_with(self): base = Red color = Lime.get_for_brightness(0.5) result = base.cover_with(color) self.assertEqual(result, Color(128, 127, 0, 255))
def test_alpha_mixing(self): img = image_factory([[Red]]) semi_transparent_green = Lime.get_for_brightness(0.5) img.draw(Pixel(0, 0), semi_transparent_green) result = img.get_color(0, 0) self.assertEqual(result, Color(128, 127, 0, 255))