예제 #1
0
 def test_color_hex(self):
     """BranchColor: to_hex() method."""
     black = PX.BranchColor(0, 0, 0)
     self.assertEqual(black.to_hex(), "#000000")
     white = PX.BranchColor(255, 255, 255)
     self.assertEqual(white.to_hex(), "#ffffff")
     green = PX.BranchColor(14, 192, 113)
     self.assertEqual(green.to_hex(), "#0ec071")
예제 #2
0
 def color(self, elem):
     """Create branch color object."""
     red, green, blue = (_get_child_text(elem, color, int)
                         for color in ("red", "green", "blue"))
     return PX.BranchColor(red, green, blue)
예제 #3
0
 def color(self, elem):
     red, green, blue = (_get_child_text(elem, color, int) for color in
                         ('red', 'green', 'blue'))
     return PX.BranchColor(red, green, blue)
예제 #4
0
 def color(self, elem):
     """Create branch color object."""
     red, green, blue = (_get_child_text(elem, color, int) for color in
                         ('red', 'green', 'blue'))
     return PX.BranchColor(red, green, blue)