can be used in plugin config to choose the color of an object.
- Code: Select all
def startColorWheel(self):
rgbINT = ["" for i in range(3)]
try:
p= os.popen("osascript -e 'tell application \"finder\" to activate return choose color' ") # start color chooser / wheel / spectrum
rgbINT = p.read().strip("\n").split(",") # returns eg '65145,32007,13\n' --> {65145,32007,13}
p.close()
# convert form 0-65xxx to 0-255 ie 16 bit to 8 bit then drop the x0 infront of ff --> ffaa82 and concatenate
rgbHEX = str(hex(int(int(rgbINT[0])/256)))[2:] +str(hex(int(int(rgbINT[1])/256)))[2:]+str(hex(int(int(rgbINT[2])/256)))[2:]
except:
return""
return rgbHEX