Exemplo n.º 1
0
 def test_hsl_to_rgb(self):
     assert_items_almost_equal((1, 0.5, 0),
                               grapefruit.hsl_to_rgb(30.0, 1.0, 0.5))
     assert_items_almost_equal((1, 0.5, 0.25),
                               grapefruit.hsl_to_rgb(20.0, 1.0, 0.625))
     assert_items_almost_equal((0.75, 0.5, 0),
                               grapefruit.hsl_to_rgb(40.0, 1.0, 0.375))
Exemplo n.º 2
0
 def test_hsl_to_rgb(self):
   assert_items_almost_equal((1, 0.5, 0), grapefruit.hsl_to_rgb(30.0, 1.0, 0.5))
   assert_items_almost_equal((1, 0.5, 0.25), grapefruit.hsl_to_rgb(20.0, 1.0, 0.625))
   assert_items_almost_equal((0.75, 0.5, 0), grapefruit.hsl_to_rgb(40.0, 1.0, 0.375))
Exemplo n.º 3
0
 def test_hsl_to_rgb_tuple(self):
   assert_items_almost_equal((1, 0.5, 0), grapefruit.hsl_to_rgb(((30.0, 1.0, 0.5))))
Exemplo n.º 4
0
 def test_set_hsl_hue(self):
   col = grapefruit.Color.from_hsl(30, 1, 0.5)
   col.hsl_hue = 40
   assert_equal(col.hsl, (40, 1, 0.5))
   assert_equal(col.rgb, grapefruit.hsl_to_rgb(40, 1, 0.5))
Exemplo n.º 5
0
 def test_hsl_to_rgb_tuple(self):
     assert_items_almost_equal((1, 0.5, 0),
                               grapefruit.hsl_to_rgb(((30.0, 1.0, 0.5))))
Exemplo n.º 6
0
 def test_set_hsl_hue(self):
     col = grapefruit.Color.from_hsl(30, 1, 0.5)
     col.hsl_hue = 40
     assert_equal(col.hsl, (40, 1, 0.5))
     assert_equal(col.rgb, grapefruit.hsl_to_rgb(40, 1, 0.5))