diff --git a/src/main/webapp/WEB-INF/jsp/index.jsp b/src/main/webapp/WEB-INF/jsp/index.jsp index b793aef..4fdea5e 100644 --- a/src/main/webapp/WEB-INF/jsp/index.jsp +++ b/src/main/webapp/WEB-INF/jsp/index.jsp @@ -118,8 +118,21 @@ }); $('#par56select').change(function() { $('#par56select option:selected').each(function() { - var hexstring = '#' + devices[$(this).attr('name')].red.toString(16) + devices[$(this).attr('name')].green.toString(16) + devices[$(this).attr('name')].blue.toString(16); - console.log(hexstring); + var red = devices[$(this).attr('name')].red.toString(16); + if(red.length == 1) { + red += red; + } + var green = devices[$(this).attr('name')].green.toString(16); + if(green.length == 1) { + green += green; + } + var blue = devices[$(this).attr('name')].blue.toString(16); + if(blue.length == 1) { + + blue += blue; + } + var hexstring = '#' + red + green + blue; + console.log(hexstring); colorpicker_raum1.hex(hexstring); }); }); @@ -208,4 +221,4 @@ - \ No newline at end of file +