davinci: light: Simplify alpha scaling logic

Change-Id: I9b5c15d5ec4865d3bf829457d6f110ddb3af6e94
This commit is contained in:
Demon000 2020-02-15 11:16:27 +00:00 committed by Arian
parent 25523a776d
commit b7413b8791
No known key found for this signature in database
GPG Key ID: 48029380598CE3B9

View File

@ -62,13 +62,11 @@ static uint32_t getBrightness(const LightState& state) {
blue = state.color & 0xFF;
/*
* Scale RGB brightness if Alpha brightness is not 0xFF.
* Scale RGB brightness using Alpha brightness.
*/
if (alpha != 0xFF) {
red = red * alpha / 0xFF;
green = green * alpha / 0xFF;
blue = blue * alpha / 0xFF;
}
red = red * alpha / 0xFF;
green = green * alpha / 0xFF;
blue = blue * alpha / 0xFF;
return (77 * red + 150 * green + 29 * blue) >> 8;
}