raspap-webgui-mirror/app/js/huebee.js

23 lines
529 B
JavaScript
Raw Permalink Normal View History

2020-06-30 15:46:51 +00:00
// Initialize Huebee color picker
var elem = document.querySelector('.color-input');
var hueb = new Huebee( elem, {
notation: 'hex',
saturations: 2,
customColors: [ '#d8224c', '#dd4814', '#ea0', '#19f', '#333' ],
className: 'light-picker',
hue0: 210
});
// Set custom color if defined
var color = getCookie('color');
if (color == null || color == '') {
2022-04-24 09:11:01 +00:00
color = '#2b8080';
2020-06-30 15:46:51 +00:00
}
hueb.setColor(color);
// Change event
hueb.on( 'change', function( color, hue, sat, lum ) {
setCookie('color',color,90);
})