diff --git a/CHANGELOG.md b/CHANGELOG.md index 2acc1f78..11fd9208 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,17 @@ # Changelog +## 0.17.5 + +- widgets + - **new** `rgbled` widget + + ## 0.17.4 - bug fixes - broken `--blank` option fixed (false-positive detection of concurrency with `--read-only`) - remove debug message in console when closing windows - + ## 0.17.3 Hot fix for `--read-only` switch. diff --git a/resources/docs/user-guide/widgets-specifics/plots.md b/resources/docs/user-guide/widgets-specifics/plots.md index af91ad7d..2762537c 100644 --- a/resources/docs/user-guide/widgets-specifics/plots.md +++ b/resources/docs/user-guide/widgets-specifics/plots.md @@ -21,6 +21,17 @@ Plots are tools that display other widgets' state or incomming osc messages. The - usage: set to true use logarithmic scaling +## RgbLed + +```js +{ + type:'rgbled', + // etc +} +``` + +This one is like the `led` except it takes three arguments (red, green and blue values between 0 and 255) with an optionnal forth argument (alpha, between 0 and 1) + ## Plot diff --git a/src/browser/js/app/widgets.js b/src/browser/js/app/widgets.js index 009aa612..c35e8087 100644 --- a/src/browser/js/app/widgets.js +++ b/src/browser/js/app/widgets.js @@ -21,6 +21,7 @@ var widgets = { // plots led: require('./widgets/plots/led'), + rgbled: require('./widgets/plots/rgbled'), plot: require('./widgets/plots/plot'), eq: require('./widgets/plots/eq'), visualizer: require('./widgets/plots/visualizer'), @@ -45,7 +46,7 @@ module.exports.categories = { 'Buttons':['toggle','push','switch'], 'Pads':['xy','rgb','multixy'], 'Matrices':['multifader','multitoggle','multipush', 'keyboard'], - 'Plots':['plot','eq','visualizer','led','meter','text'], + 'Plots':['plot','eq','visualizer','led', 'rgbled','meter','text'], 'Containers':['panel','strip','modal'], 'Switchers':['switcher','crossfader'], 'Maths':['formula'] diff --git a/src/browser/js/app/widgets/plots/rgbled.js b/src/browser/js/app/widgets/plots/rgbled.js new file mode 100644 index 00000000..2eba41c9 --- /dev/null +++ b/src/browser/js/app/widgets/plots/rgbled.js @@ -0,0 +1,88 @@ +var {mapToScale} = require('../utils'), + _widgets_base = require('../common/_widgets_base'), + {widgetManager} = require('../../managers'), + {clip} = require('../utils') + +module.exports = class Led extends _widgets_base { + + static options() { + + return { + type:'rgbled', + id:'auto', + + _style:'style', + + label:'auto', + left:'auto', + top:'auto', + width:'auto', + height:'auto', + css:'', + + _plot:'plot', + + widgetId:'', + + _osc:'osc', + + value:'', + preArgs:[], + address:'auto' + + } + + } + + constructor(widgetData) { + + var widgetHtml = ` +