forked from donjohanliebert/hardware_xiaomi
aidl: light: Don't scale RGB brightness if alpha is 0
* Fixes custom LED colors Change-Id: I14150292a0a3d8411a26e45f8a4fa4b40f3101b7
This commit is contained in:
parent
f162d20b5b
commit
2d6bc53b95
@ -61,7 +61,7 @@ argb_t colorToArgb(uint32_t color) {
|
||||
r.blue = color & 0xFF;
|
||||
|
||||
// Scale RGB colors if a brightness has been applied by the user
|
||||
if (r.alpha != 0xFF) {
|
||||
if (r.alpha > 0 && r.alpha < 255) {
|
||||
r.red = r.red * r.alpha / 0xFF;
|
||||
r.green = r.green * r.alpha / 0xFF;
|
||||
r.blue = r.blue * r.alpha / 0xFF;
|
||||
|
Loading…
Reference in New Issue
Block a user