Пример #1
0
 def test_get_property_2(self):
     color = tam_colors.Color(-2, 4, tam_colors.RGBA(255, 0, 0, 200), 200, 5)
     self.assertEqual(color.mode_2, 5)
     self.assertEqual(color.mode_16_pal_256, 200)
     self.assertEqual(color.mode_16, -2)
     self.assertEqual(color.mode_256, 4)
     self.assertEqual(color.mode_rgb, tam_colors.RGBA(255, 0, 0, 200))
Пример #2
0
 def test_get_property_2(self):
     rgb = tam_colors.RGBA(54, 65, 75, 0, True)
     self.assertEqual(rgb.r, 54)
     self.assertEqual(rgb.g, 65)
     self.assertEqual(rgb.b, 75)
     self.assertEqual(rgb.a, 0)
     self.assertEqual(rgb.is_default, True)
Пример #3
0
 def test_get_property(self):
     rgb = tam_colors.RGBA(55, 66, 77)
     self.assertEqual(rgb.r, 55)
     self.assertEqual(rgb.g, 66)
     self.assertEqual(rgb.b, 77)
     self.assertEqual(rgb.a, 255)
     self.assertEqual(rgb.is_default, False)
Пример #4
0
 def _get_console_color(self, spot):
     """
     info: Will get a console color
     :param spot: int
     :return: RGBA
     """
     spot = self._spot_swap(spot)
     return tam_colors.RGBA(*io._get_rgb_color(spot))
Пример #5
0
 def test_rgba_ne_2(self):
     rgb = tam_colors.RGBA(55, 66, 77)
     self.assertFalse(rgb != tam_colors.RGBA(55, 66, 77))
Пример #6
0
 def test_rgba_ne(self):
     rgb = tam_colors.RGBA(55, 66, 77)
     self.assertTrue(rgb != tam_colors.RGBA(55, 66, 77, 88))
Пример #7
0
 def test_rgba_eq_3(self):
     rgb = tam_colors.RGBA(55, 66, 77)
     self.assertFalse(rgb == "RGBA")
Пример #8
0
 def test_rgba_eq_2(self):
     rgb = tam_colors.RGBA(55, 66, 77)
     self.assertFalse(rgb == tam_colors.RGBA(55, 66, 77, 88))
Пример #9
0
 def test_rgba_eq(self):
     rgb = tam_colors.RGBA(55, 66, 77)
     self.assertTrue(rgb == tam_colors.RGBA(55, 66, 77))
Пример #10
0
 def test_rgba_init_2(self):
     rgb = tam_colors.RGBA(55, 66, 77, 56, False)
     self.assertIsInstance(rgb, tam_colors.RGBA)
Пример #11
0
 def test_color_eq(self):
     self.assertTrue(tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0)) ==
                     tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0)))
Пример #12
0
 def test_color_init(self):
     color = tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0))
     self.assertIsInstance(color, tam_colors.Color)
Пример #13
0
 def test_get_property(self):
     color = tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0))
     self.assertEqual(color.mode_2, 3)
     self.assertEqual(color.mode_16, 3)
     self.assertEqual(color.mode_256, 4)
     self.assertEqual(color.mode_rgb, tam_colors.RGBA(255, 0, 0))
Пример #14
0
 def test_color_ne_2(self):
     self.assertFalse(tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0)) !=
                      tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0)))
Пример #15
0
 def test_color_ne(self):
     self.assertTrue(tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0)) !=
                     tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 1)))
Пример #16
0
 def test_color_eq_3(self):
     self.assertFalse(tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0)) == "COLORS")
Пример #17
0
 def test_color_eq_2(self):
     self.assertFalse(tam_colors.Color(3, 4, tam_colors.RGBA(255, 0, 0)) ==
                      tam_colors.Color(-2, 4, tam_colors.RGBA(255, 0, 0, 200), 5))
Пример #18
0
 def test_rgba_init(self):
     rgb = tam_colors.RGBA(55, 66, 77)
     self.assertIsInstance(rgb, tam_colors.RGBA)
Пример #19
0
 def test_color_init_2(self):
     color = tam_colors.Color(-2, 4, tam_colors.RGBA(255, 0, 0, 200), 5)
     self.assertIsInstance(color, tam_colors.Color)