aidl: light: Don't scale RGB brightness if alpha is 0

* Fixes custom LED colors

Change-Id: I14150292a0a3d8411a26e45f8a4fa4b40f3101b7
This commit is contained in:
BeYkeRYkt 2021-09-27 01:15:39 +07:00 committed by Sebastiano Barezzi
parent f162d20b5b
commit 2d6bc53b95
No known key found for this signature in database
GPG Key ID: 47760583F393BC44

View File

@ -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;