We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey,
I need to access the individual RGB values of color. Anybody know what they're called?
Thanks.
Hex Values, here's a link
Accessing rgb components of color "col":
r = red(col); g = green(col); b = blue(col); // this is faster r = ((col >> 16) & 0xFF); g = ((col >> 8) & 0xFF); b = (col & 0xFF);
For the faster approach above, no need for extra parens at all: :P
color c = #D82AC0; int r = c>>020 & 0xff; int g = c>>010 & 0xff; int b = c & 0xff;
And if you happen to need the alpha property too, here's how: *-:)
int a = c>>>030;
@ GoToLoop: thanks master :)
Thx @cameyo! And for completeness' sake, a link to 2 utility RGB conversion functions: O:-) https://forum.Processing.org/two/discussion/comment/56767/#Comment_56767
@GoToLoop: nice functions. Your posts are very useful ^:)^
Answers
Hex Values, here's a link
Accessing rgb components of color "col":
For the faster approach above, no need for extra parens at all: :P
And if you happen to need the alpha property too, here's how: *-:)
@ GoToLoop: thanks master :)
Thx @cameyo! And for completeness' sake, a link to 2 utility RGB conversion functions: O:-)
https://forum.Processing.org/two/discussion/comment/56767/#Comment_56767
@GoToLoop: nice functions.
Your posts are very useful ^:)^