Control visual parameter of an element

Usually for made visual changes in a module we change directly all the svg file, but if i want to change the color of a dot for example, is it possible change it gradually via an apposite function?

for a better explanation:

if (x>0){
 SvgLed1.changeRGBColor(255,0,0);
}

Many thanks to all.

In Rack, creste a light and call setBrightness on it.