xanimalkingx Registered User |
Quote
|
2018-07-16 01:34:04 |
|
I am developing a action extension and have a color property. However, I need the individual values from the color, like the R, G, and B values.
I don't see any function like getRed(), so how do I do this?
|
niko Moderator |
Quote
|
2018-07-16 08:38:12 |
|
These should work:
function getRedColor(clr) { return ((clr & 0x00FF0000) >> 16); }
function getGreenColor(clr) { return ((clr & 0x0000FF00) >> 8); }
function getBlueColor function(clr) { return ((clr & 0x000000FF)); }
|
xanimalkingx Registered User |
Quote
|
2018-07-16 16:31:43 |
|
It works but you should add these as official functions in the scripting API.
|
niko Moderator |
Quote
|
2018-07-17 05:15:40 |
|
You are right, probably going to add those.
|