自动计算不同lab值的增量e

kq0g1dla  于 2021-08-25  发布在  Java
关注(0)|答案(0)|浏览(303)
from colormath.color_diff import delta_e_cie2000
from colormath.color_objects import LabColor

color1 = LabColor(lab_l=80.4569, lab_a=2.1034, lab_b=53.0929)
color2 = LabColor(lab_l=88.8133, lab_a=-0.9955, lab_b=25.3040)
color3 = LabColor(lab_l=84.7402, lab_a=-0.4937, lab_b=38.7848)
color4 = LabColor(lab_l=81.2277, lab_a=1.3795, lab_b=45.8783)
color5 = LabColor(lab_l=84.0132, lab_a=-0.4293, lab_b=34.9080)
color6 = LabColor(lab_l=83.2528, lab_a=0.5219, lab_b=42.0932)
color7 = LabColor(lab_l=83.3647, lab_a=-0.5631, lab_b=39.7694)

A = delta_e_cie2000(color1, color2), delta_e_cie2000(color1, color3), delta_e_cie2000(color1, color4), delta_e_cie2000(color1, color5), delta_e_cie2000(color1, color6), delta_e_cie2000(color1, color7)
B = delta_e_cie2000(color2, color3), delta_e_cie2000(color2, color4), delta_e_cie2000(color2, color5), delta_e_cie2000(color2, color6), delta_e_cie2000(color2, color7)
C = delta_e_cie2000(color3, color4), delta_e_cie2000(color3, color5), delta_e_cie2000(color3, color6), delta_e_cie2000(color3, color7)
D = delta_e_cie2000(color4, color5), delta_e_cie2000(color4, color6), delta_e_cie2000(color4, color7)
E = delta_e_cie2000(color5, color6), delta_e_cie2000(color5, color7)
F = delta_e_cie2000(color6, color7)

print(A)
print(B)
print(C)
print(D)
print(E)
print(F)

使用这个脚本,我计算每种颜色之间的增量e。它很好用,但当我必须添加另一种颜色时,这需要做很多工作。所以我的问题是:有没有一个函数可以同时比较每种颜色?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题