How to use color?

Im trying to use color variables to change the fillcolor of rectangles but I don’t udnerstand how it works

I tried for example rectangle.fillcolor = color.magenta but I get an error

pls can u post an example of setting the colors of a control using COLOR
thanks a lot


Color.magenta returns the magenta component of the color, it does not return a color object for the color magenta. Instead use the RGB/HSV/CMY functions to define your colors, or the &c color literal.