Imagine you have a temporary toggle pad for requesting a globals dump, changing a patch etc… but you need more certainty you’ve actually pressed the button, so you’re preventing yourself from pressing it a second time.
Here’s code “showOrange” you could add to a purple pad as a function; that will convert it to Orange when pressed On and back to Purple when pressed Off:
function showOrange(valueObject,value)
if value ==0 then
valueObject:getControl():setColor(PURPLE)
else
valueObject:getControl():setColor(ORANGE)
end
end