Code:
Problem description: It says you can use colours, but in what format will it take a colour. I tried various ways... well besides the name of the colour maybe that is it. But than how would you change the alpha? I wouldnt mind some examples too thank you
There are also a bunch of colours you can use as a text string.
color = "white" // white So there's a few examples of three ways you can go about doing the same thing. To use this with animate, you just use the animate() proc as Mr_Goober mentioned above. |
You can also include the alpha in rgb() as the fourth argument, for atom.color. It'll override changes to atom.alpha.
|
To use it in rgb() the syntax would be
rgb(red, green, blue, alpha) all arguments being a number from 0 - 255. That would look like
animate(icon, color = rgb(255, 255, 255, 128) // white (no color change to the icon), with half alpha (half-see-through)
Or you can set the alpha as an argument in animate() animate(icon, color = rgb(255, 255, 255), alpha = 128) // The same as above. |
In regards to hex values, each component is a value 0 to 255 (00 to ff in hex). White would be #ffffff and black would be #000000. All color is composed of red, green, and blue light, hence the #rrggbb format.
To change the color of an atom in animate (), use the "color" named argument.
animate(the_atom, color = "#ffffff", time = 10)
edit: BYOND comes equipped with a handy rgb() function which takes numerical values and spits out a hex code for you.
rgb(255,0,0) // result is red