def test_slate_gray(self): lab = rgb2lab(hex_to_rgb("#708090")) self.assertEqual(lab.L, 52.83625796271889) self.assertAlmostEqual(lab.a, -2.1385958505868996, places=15) self.assertEqual(lab.b, -10.57740141476744)
def test_black(self): (red, green, blue) = hex_to_rgb("#000000") self.assertEqual(red, 0) self.assertEqual(green, 0) self.assertEqual(blue, 0)
def test_slate_gray(self): (red, green, blue) = hex_to_rgb("#708090") self.assertEqual(red, 112) self.assertEqual(green, 128) self.assertEqual(blue, 144)
def test_white(self): (red, green, blue) = hex_to_rgb("#FFFFFF") self.assertEqual(red, 255) self.assertEqual(green, 255) self.assertEqual(blue, 255)