Closed lx1054331851 closed 7 years ago
below is my code and the results, I don't no whether I write the wrong code, help!
from colormath.color_objects import LabColor, sRGBColor, XYZColor from colormath.color_conversions import convert_color rgb = sRGBColor(244, 55, 66) xyz = convert_color(rgb, XYZColor, through_rgb_type=sRGBColor) print(xyz.xyz_x, xyz.xyz_y, xyz.xyz_z) # result: (203201.9917460821 111379.08009724967 30202.181100844653) lab = convert_color(xyz, LabColor, through_rgb_type=sRGBColor) print(lab.lab_l, lab.lab_a, lab.lab_b) # result: (5565.1778859096485 5840.582567869284 3568.530135463184)
By default sRGBColor takes arguments in the range 0...1. If you need it to take arguments in the range 0...255 you need to set the optional argument is_upscaled=True.
sRGBColor
is_upscaled=True
below is my code and the results, I don't no whether I write the wrong code, help!