Beispiel #1
0
 def test_create_from_file(self):
     c = ColorChooser.createFromDefinition("resources/colortest.txt")
     self.assertEqual(len(c._colorList), 3)
     self.assertEqual(c.findColor("First Color"), (255, 0, 0))
     self.assertEqual(c.findColor("Other Color"), (0, 255, 0))
     self.assertEqual(c.findColor("Third Color"), (0, 0, 255))
     self.assertEqual(c.currentColor(), (255, 0, 0))
     self.assertEqual(c.nextColor(), (0, 255, 0))
     self.assertEqual(c.nextColor(), (0, 0, 255))
Beispiel #2
0
 def test_interval(self):
     c = ColorChooser.createFromDefinition("resources/colortest.txt")
     self.assertEqual(c.currentColor(), (255, 0, 0))
     self.assertEqual(c.nextColor(2), (0, 0, 255))
Beispiel #3
0
 def _loadColors(self, skinPath:str, colorFileName:str):
     return ColorChooser.createFromDefinition(os.path.join(skinPath, colorFileName))