Hello! I am trying to get an RGB Widget to change the "colorWidget" value of another widget (ex: a button). I am not sure how the rgb widget is sending out the color value...
Hello,
It sends the colors as an array, like so:
const rgbWithoutAlpha = [0, 0, 0] //without alpha channel
const rgbWithAlpha = [0, 0, 0, 0] //with alpha channel
Clelson,
Thanks for your reply.
I was hoping that putting @{rgb_1.rgbWithoutAlpha} in my button's colorWidget input would do the trick.. It does not..
I don't have much experience with scripting.. Will I have to make a custom script?
Oh, sorry, that was just an example of how the values are sent from the rgb widget using javascript syntax.
In order to have their value to work in the colorWidget prop of your button, you can use this syntax:
#{`rgb(${@{rgb_1}.join(",")})`}
It's a OSC javascript block that basically returns the rgb array value concatenated as a string, in the format of rgb(r, g, b)
.
Hope it helps.
Wow! This is great! Thanks Clelson!