def paletteTest1(): cdrObj = CDR() paletteObj = cdrObj.accessPalette('my') cdrObj.setPletteEnabled(paletteObj) #启用 # 创建一个颜色对象,使用指定格式 color = cdrObj.createColorObj([110, 128, 255], 'unique_key', 'RGB') # 把颜色增加到调色板上 cdrObj.addPletteColor(paletteObj, color)
def paletteTest2(): cdrObj = CDR() paletteObj = cdrObj.accessPalette('my') newColor = cdrObj.createColorObj([0, 255, 255], 'unique_key', 'RGB') cdrObj.replacePletteColorByName(paletteObj, newColor)