Update Formulas in Convert XY to RGB (#6322)
* Update to Current RGB D65 Conversion As per Philips Hue https://developers.meethue.com/documentation/color-conversions-rgb-xy * Update the source of the XYZ to RGB formulas * Fix Whitespace * Update Whitespace * Update Tests for new Formulas * Update Tests * Update XY_Brightness_to_hsv tests * Update test_color.py
This commit is contained in:
1 parent
e14d6f11c6
commit
edd5db296d
3 files changed
+12
-13
No files matched your search
@@ -27,16 +27,16 @@ class TestColorUtil(unittest.TestCase):
|
||||
self.assertEqual((0, 0, 0),
|
||||
color_util.color_xy_brightness_to_RGB(1, 1, 0))
|
||||
|
||||
self.assertEqual((255, 235, 214),
|
||||
self.assertEqual((255, 243, 222),
|
||||
color_util.color_xy_brightness_to_RGB(.35, .35, 255))
|
||||
|
||||
self.assertEqual((255, 0, 45),
|
||||
self.assertEqual((255, 0, 60),
|
||||
color_util.color_xy_brightness_to_RGB(1, 0, 255))
|
||||
|
||||
self.assertEqual((0, 255, 0),
|
||||
color_util.color_xy_brightness_to_RGB(0, 1, 255))
|
||||
|
||||
self.assertEqual((0, 83, 255),
|
||||
self.assertEqual((0, 63, 255),
|
||||
color_util.color_xy_brightness_to_RGB(0, 0, 255))
|
||||
|
||||
def test_color_RGB_to_hsv(self):
|
||||
@@ -61,16 +61,16 @@ class TestColorUtil(unittest.TestCase):
|
||||
self.assertEqual(color_util.color_RGB_to_hsv(0, 0, 0),
|
||||
color_util.color_xy_brightness_to_hsv(1, 1, 0))
|
||||
|
||||
self.assertEqual(color_util.color_RGB_to_hsv(255, 235, 214),
|
||||
self.assertEqual(color_util.color_RGB_to_hsv(255, 243, 222),
|
||||
color_util.color_xy_brightness_to_hsv(.35, .35, 255))
|
||||
|
||||
self.assertEqual(color_util.color_RGB_to_hsv(255, 0, 45),
|
||||
self.assertEqual(color_util.color_RGB_to_hsv(255, 0, 60),
|
||||
color_util.color_xy_brightness_to_hsv(1, 0, 255))
|
||||
|
||||
self.assertEqual(color_util.color_RGB_to_hsv(0, 255, 0),
|
||||
color_util.color_xy_brightness_to_hsv(0, 1, 255))
|
||||
|
||||
self.assertEqual(color_util.color_RGB_to_hsv(0, 83, 255),
|
||||
self.assertEqual(color_util.color_RGB_to_hsv(0, 63, 255),
|
||||
color_util.color_xy_brightness_to_hsv(0, 0, 255))
|
||||
|
||||
def test_rgb_hex_to_rgb_list(self):
|
||||
|
||||
Reference in new issue
Block a user