Fixed some issues resulting in the X and Y based color functions not working.
Added a simple intensity calculation from RGB values to control dimming - maximum of the individual components. The components are expected to fall between 0 and 255.
This should result in colors as bright as possible and works well enough - tested with Tradfri color bulbs.
There are however other ways to approach this. For instance the eclipse/smarthome XY conversion includes the capital Y value in the brightness calculation. Maybe this results in more natural dimming curves but I'm not sure. It looks like the dimmer never goes full this way though. In any case it might be worth investigating.
Fixed some issues resulting in the X and Y based color functions not working.
Added a simple intensity calculation from RGB values to control dimming - maximum of the individual components. The components are expected to fall between 0 and 255. This should result in colors as bright as possible and works well enough - tested with Tradfri color bulbs.
There are however other ways to approach this. For instance the eclipse/smarthome XY conversion includes the capital Y value in the brightness calculation. Maybe this results in more natural dimming curves but I'm not sure. It looks like the dimmer never goes full this way though. In any case it might be worth investigating.