node-red-contrib-nanoleaf
Version:
[](https://nodered.org) [](https://nodejs.org/en/) [ • 2.16 kB
HTML
<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>