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

fhemweb_colorpicker.js: fixed preset for BRI mode

git-svn-id: https://svn.fhem.de/fhem/trunk@23068 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2020-11-01 16:15:57 +00:00
parent d5fe5dac35
commit 13466db341

View File

@ -33,6 +33,10 @@ FW_colorpickerCreate(elName, devName, vArr, currVal, set, params, cmd)
var color = params[0];
if( mode == 'CT' )
color = colorpicker_ct2rgb(color);
else if( mode == 'BRI' ) {
color = parseInt(255 * color / vArr[4]);
color = colorpicker_rgb2hex(color,color,color);
}
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]) });