Commit 83a2464a80e2dba8646817c853dd75f7eb3ce95d
1 parent
18b84291
fix calculation where float division was needed, but normal division was used
Showing
1 changed file
with
3 additions
and
3 deletions
hueplusplus/SimpleColorHueStrategy.cpp
| ... | ... | @@ -248,9 +248,9 @@ bool SimpleColorHueStrategy::setColorXY(float x, float y, uint8_t transistion, H |
| 248 | 248 | |
| 249 | 249 | bool SimpleColorHueStrategy::setColorRGB(uint8_t r, uint8_t g, uint8_t b, uint8_t transistion, HueLight& light) const |
| 250 | 250 | { |
| 251 | - float red = r / 255; | |
| 252 | - float green = g / 255; | |
| 253 | - float blue = b / 255; | |
| 251 | + float red = float(r) / 255; | |
| 252 | + float green = float(g) / 255; | |
| 253 | + float blue = float(b) / 255; | |
| 254 | 254 | |
| 255 | 255 | // gamma correction |
| 256 | 256 | red = (red > 0.04045f) ? pow((red + 0.055f) / (1.0f + 0.055f), 2.4f) : (red / 12.92f); | ... | ... |