[Scarpet suggestion] color() method for converting colors
replaceitem opened this issue ยท 5 comments
A function for conveting colors from various color models, for example:
color('rgb','hex',[255,128,0])
returns the color in hex as a string : #FF8000
or
color('hsb','hex',[40,128,0])
converts from hue, saturation and brightnes to a hex string
or
color('hex','rgb','#22FF00')
converts from hex string to a list of red, green and blue values
This would be usefull for the format()
function:
format(str('%s Test',color('rgb','hex',255,128,32)))
Im relatively sertain that is already possible with existing scarpet, but lemme check
It surely is with maths, but thats a lof of work, especially converting with hue saturation and brightnes, it would be much sinpler to just use a function, that uses javas converting functions