2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

fhemweb_colorpicker.js: added preset display for HUE mode

git-svn-id: https://svn.fhem.de/fhem/trunk@25806 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2022-03-10 12:37:59 +00:00
parent 55d9f2869f
commit b320766827

View File

@ -36,7 +36,12 @@ FW_colorpickerCreate(elName, devName, vArr, currVal, set, params, cmd)
else if( mode == 'BRI' ) {
color = parseInt(255 * color / vArr[4]);
color = colorpicker_rgb2hex(color,color,color);
}
} else if( mode == 'HUE' ) {
var h = 255 * params[0] / vArr[4];
var s = 1;
var v = 1;
var color = colorpicker_hsv2rgb(h,s,v);
}
var newEl = $('<div informID="###" style="width:32px;height:19px;border:1px solid #fff;border-radius:8px;background-color:#'+color+'" >').get(0);
$(newEl).click(function(arg) { cmd(params[0]) });