Skip to content

Commit

Permalink
fix black base layer special case
Browse files Browse the repository at this point in the history
  • Loading branch information
profezzorn committed Nov 5, 2024
1 parent efc408f commit 2034ba1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions styles/layers.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ class Compose<BLACK, L1> {
}
private:
PONUA L1 layer_;
SimpleColor dealpha(const SimpleColor& color) { return color; }
OverDriveColor dealpha(const OverDriveColor& color) { return color; }
SimpleColor dealpha(const RGBA_um_nod& color) { return SimpleColor(color.c * color.alpha >> 15; }
OverDriveColor dealpha(const RGBA_um& color) { return OverDriveColor(color.c * color.alpha >> 15, color.overdrive); }
SimpleColor dealpha(const RGBA_nod& color) { return SimpleColor(color.c); }
OverDriveColor dealpha(const RGBA& color) { return OverDriveColor(color.c, color.overdrive); }
public:
SimpleColor getColor(int led) {
return SimpleColor(layer_.getColor(led).c);
}
auto getColor(int led) -> AUTO_RETURN(dealpha(layer_.getColor(led)));
};


Expand Down

0 comments on commit 2034ba1

Please sign in to comment.