iobroker-community-adapters / ioBroker.openhab

Connect ioBroker with openHAB
MIT License
13 stars 3 forks source link

RGBtoHex failure #14

Closed Schluesselmeister closed 6 years ago

Schluesselmeister commented 6 years ago

The function RGBtoHex has to be updated. The following lines have to be exchanged: line 108 ff: if (rgb.r.length == 1) { rgb.r = '0' + rgb.r; } if (rgb.g.length == 1) { rgb.g = '0' + rgb.g; } if (rgb.b.length == 1) { rgb.b = '0' + rgb.b; }

to replaced with:

if (hex[0].length == 1) { hex[0] = "0" + hex[0];} if (hex[1].length == 1) { hex[1] = "0" + hex[1];} if (hex[2].length == 1) { hex[2] = "0" + hex[2];}

Sorry.

Schluesselmeister commented 6 years ago

Will correct it with the next version containing more Color type support.

Schluesselmeister commented 6 years ago

Added the fix to the latest pull request #16.

Schluesselmeister commented 6 years ago

Merged into master.