jean-emmanuel / open-stage-control

Libre and modular OSC / MIDI controller
https://openstagecontrol.ammd.net
GNU General Public License v3.0
695 stars 88 forks source link

Simple Change Color from JS #811

Closed grassinicristiano closed 1 year ago

grassinicristiano commented 1 year ago

Hi Jean-emmanuel,

I've my "mainScript" very easy:

var n = (get('MainScript').toFixed(3)*1000) if (n !== 0) { setInterval(function () { n=n-100 var date = new Date(0) date.setSeconds(((n/1000)).toFixed(0)) var timeString = date.toISOString().substring(11, 19); set('timeDisplay', timeString); set('messageArea', "");

            // tempo 0 esce dal loop
          if (n <= 0) {
            clearInterval();
            set('timeDisplay', "--:--:--");
            set('messageArea', 'Completed!');
          }

        }, 100)

}

else { clearInterval();

set('messageArea', 'Stopped by User or 0 time cue') set('timeDisplay', "--:--:--"); set('currentCue', "None...");

}

There'a way to change text color of widget "timeDisplay" when "n"<somevalue?

Thankyou

Cistiano

jean-emmanuel commented 1 year ago

Hi, Please use the forum for usage questions, this place is to be preferred for bug reports. https://openstagecontrol.discourse.group/ (providing a bit more context should also help users to help you)

grassinicristiano commented 1 year ago

Sorry, thank you