示例#1
0
 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))
示例#2
0
 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))
示例#3
0
 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))
示例#4
0
 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))