I am randomly generating values for the RGB of Tint color but it wants the values in RGB. How do I accomplish that?
I have variables:
- RedRandom
- GreenRandom
- BlueRandom
And I want to be able to put in the Tint Color expression: RedRandom + “,” + GreenRandom + “,” + BlueRandom.
Thanks!
Figured it out. I had to put the enter expression in a different variable such as.
RGB = ToString(RedRandom) + “,” + ToString(GreenRandom) + “,” + ToString(BlueRandom)
and then use the following expression for TintColor change.
ToString(RGB)
While this helps in changing the colors, it is definitely not obeying the RGB. My object base color is completely white - so it should follow.
For example, I have but a debugger (text) underneath and it would be showing 255,0,10 and the color would be greyish green.
Then other times it would show blue whereas green is more predominant.
It looks like you’re using commas. You need to use semicolons. It can be a string or a string variable. Anything that resolves to #;#;# like 0;0;0
Set Tint to ToString(r) + ";" + ToString(g) + ";" + ToString(b)
r, g and b can be variables or the expressions that are used to set r, g and b.
Set Tint to ToString(Random (255)) + ";" + ToString(Random (255) ) + ";" + ToString(Random (255))