Button coulour change based on value

0
Hi,   i made a database based on mqtt messages where i recive different colourcodes. These colourcodes schould turn the button in its colour. For example i recive "COLOR":"#77FF77" and want to change the buttons coller to orange. But the value is changing all 30 sec.  My thought was that i could change it in the scss file but i dont know how to make a flexible variale that connects to my data.
asked
1 answers
3

Hi Mario,

You can change the button color using Nanoflow and java script action.

 

call the nanoflow when ever color code change and create a javascript action in pass your color code.

 

document.getElementsByClassName('yourbtnclassname')[0].style.backgroundColor =colorcode;

 

a

 

answered