blendPixelColor Shortcut

Don't call color_blend if not needed.
This commit is contained in:
Brandon502
2024-07-17 14:34:17 -04:00
parent 67d777f474
commit e759c4bd16
2 changed files with 4 additions and 2 deletions

View File

@@ -1362,7 +1362,8 @@ void Segment::fill(uint32_t c) {
// Blends the specified color with the existing pixel color.
void Segment::blendPixelColor(int n, uint32_t color, uint8_t blend) {
setPixelColor(n, color_blend(getPixelColor(n), color, blend));
if (blend == UINT8_MAX) setPixelColor(n, color);
else setPixelColor(n, color_blend(getPixelColor(n), color, blend));
}
// Adds the specified color with the existing pixel color perserving color balance.