UNPKG

node-red-contrib-nanoleaf

Version:

[![platform](https://img.shields.io/badge/platform-Node--RED-red?logo=nodered)](https://nodered.org) [![Min Node Version](https://img.shields.io/node/v/node-red-contrib-nanoleaf.svg)](https://nodejs.org/en/) [![GitHub version](https://img.shields.io/githu

46 lines (44 loc) 2.16 kB
<script type="text/javascript"> RED.nodes.registerType('color', { category: 'nanoleaf', color: '#3eaf24', icon: 'nanoleaf_white.png', align: 'right', inputs: 1, outputs: 0, defaults: { name: { value: '' }, installation: { type: 'installation' } }, label: function () { return this.name || 'color'; } }); </script> <script type="text/x-red" data-template-name="color"> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name"/> </div> <div class="form-row"> <label for="node-input-installation"><i class="fa fa-tag"></i> Installation</label> <input type="text" id="node-input-installation"/> </div> </script> <script type="text/x-red" data-help-name="color"> <p>Set Nanoleaf Aurora color</p> <p>Hex where the payload is #[red 00 -> ff][green 00 -> ff][blue 0 -> ff]</p> <p>CSS color keyword from the <a href='https://drafts.csswg.org/css-color/#named-colors'>list</a></p> <p>HSV where the payload is { hue, saturation, value } or { h, s, v }</p> <p>RGB where the payload is { red, green, blue } or { r, g, b }</p> <p>HSL where the payload is { h, s, l }</p> <p>CMYK where the payload is { c, m, y, k }</p> <p>A payload with both HSV and RGB will use HSV</p> <p>HSV, RGB, HSL and CMYK can all take an additional duration property whose value is in seconds</p> <p>To pass a duration in with Hex or CSS you need to use the payload { color: [value], duration: [seconds] }</p> <p>An empty payload will currently be ignored (plan to possibly return the current color in the future).</p> <p>Currently no limits are in place, raw values are passed directly to the Nanoleaf.</p> <p>Conversions are done with the assistance of the <a href='https://www.npmjs.com/package/color-convert'>color-convert</a> library. If there are requests for any of the other formats it supports, just drop me a note.</p> </script>