Skip to content
Snippets Groups Projects
Commit 3c7ffbcc authored by Demon000's avatar Demon000
Browse files

sm6250-common: light: simplify alpha scaling logic

Change-Id: I9b5c15d5ec4865d3bf829457d6f110ddb3af6e94
parent 963ec1b2
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment