def Luv_to_LCHuv(cobj, *args, **kwargs):
"""
Convert from CIE Luv to LCH(uv).
"""
lch_l = cobj.luv_l
lch_c = math.sqrt(math.pow(cobj.luv_u, 2.0) + math.pow(cobj.luv_v, 2.0))
lch_h = math.atan2(float(cobj.luv_v), float(cobj.luv_u))
if lch_h > 0:
lch_h = (lch_h / math.pi) * 180
else:
lch_h = 360 - (math.fabs(lch_h) / math.pi) * 180
return LCHuvColor(
lch_l, lch_c, lch_h, observer=cobj.observer, illuminant=cobj.illuminant)
# noinspection PyPep8Naming,PyUnusedLocal
评论列表
文章目录