probonopd / ESP8266HueEmulator

Emulate a Philips Hue bridge running on an ESP8266 using the Arduino IDE.
MIT License
411 stars 93 forks source link

Fix rgb to hsv color conversion. #68

Closed ensonic closed 7 years ago

ensonic commented 7 years ago

Change the struct members to be floats to avoid truncating e.g v to 0. We scale r,g,b by COLOR_SATURATION and this maps them to a [0.0, 1.0] range. Setting the max of them to v, will most likely truncate this to 0.

probonopd commented 7 years ago

Thanks!