def get_color_from_editor(self, *args):
u"""colorEditor??????"""
res = cmds.colorEditor()
if "1" != res.split()[3]:
return
result = cmds.colorEditor(query=True, rgb=True)
decimal_point = cmds.intFieldGrp(self.decimal_point_field, q=True, v1=True)
r = round(result[0], decimal_point)
g = round(result[1], decimal_point)
b = round(result[2], decimal_point)
bgc = self._COLOR_FORMAT.format(str(r), str(g), str(b))
cmds.textFieldGrp(self.result_field, e=True, tx=bgc)
cmds.text(self.color_preview, e=True, bgc=[r, g, b])
评论列表
文章目录