Node-RED Dashboard Template Color not updated

280 views
Skip to first unread message

Robert Linn

unread,
Jul 28, 2016, 9:50:02 AM7/28/16
to Node-RED
Hi,

first many thanks for this great Dashboard.

In using the Dashboard template, the color, given as RGB(r,g,b) is not updated when the payload changes.
Below code, f.e. the msg.payload = RGB(255,0,0) but color not set in the first <p></p>. In the second, the color settings works.
Displaying only {{msg.payload}} shows the RGB value as RGB(255,0,0).

Any hints how to resolve setting the color dynamically?


<!DOCTYPE HTML>
<html>
<body>
<div layout="row" layout-align="space-between">
   
<p ng-style="{color: '{{msg.payload}}' }">
        RGB LED COLOR
   
</p>
   
<p ng-style="{color: 'rgb(255,0,0)' }">
        RGB LED COLOR
   
</p>
</div>
</body>
</html>



Robert Linn

unread,
Aug 12, 2016, 11:31:32 AM8/12/16
to Node-RED
Solved by setting msg.payload in () and placed as last entry in the ng-style.
  <div layout="row" layout-align="space-between">

   
<p ng-style="{'font-size':'24px','color':(msg.payload)}">
        Color set to {{msg.payload}}
   
</p>
 
</div>
Reply all
Reply to author
Forward
0 new messages