Skip to content

Commit

Permalink
using global brightness
Browse files Browse the repository at this point in the history
  • Loading branch information
Pasquale Pizzuti committed May 2, 2024
1 parent fd9570e commit 22f6128
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions wled00/overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ void _overlayAnalogClock()
{
_overlayAnalogCountdown(); return;
}
uint8_t brightness = strip.getBrightness();
float hourP = ((float)(hour(localTime)%12))/12.0f;
float minuteP = ((float)minute(localTime))/60.0f;
hourP = hourP + minuteP/12.0f;
Expand All @@ -26,11 +25,11 @@ void _overlayAnalogClock()
{
if (secondPixel < analogClock12pixel)
{
strip.setRange(analogClock12pixel, overlayMax, color_fade(0xFF0000, brightness));
strip.setRange(overlayMin, secondPixel, color_fade(0xFF0000, brightness));
strip.setRange(analogClock12pixel, overlayMax, color_fade(0xFF0000, bri));
strip.setRange(overlayMin, secondPixel, color_fade(0xFF0000, bri));
} else
{
strip.setRange(analogClock12pixel, secondPixel, color_fade(0xFF0000, brightness));
strip.setRange(analogClock12pixel, secondPixel, color_fade(0xFF0000, bri));
}
}
if (analogClock5MinuteMarks)
Expand All @@ -39,12 +38,12 @@ void _overlayAnalogClock()
{
unsigned pix = analogClock12pixel + roundf((overlaySize / 12.0f) *i);
if (pix > overlayMax) pix -= overlaySize;
strip.setPixelColor(pix, color_fade(0x00FFAA, brightness));
strip.setPixelColor(pix, color_fade(0x00FFAA, bri));
}
}
if (!analogClockSecondsTrail) strip.setPixelColor(secondPixel, color_fade(0xFF0000, brightness));
strip.setPixelColor(minutePixel, color_fade(0x00FF00, brightness));
strip.setPixelColor(hourPixel, color_fade(0x0000FF, brightness));
if (!analogClockSecondsTrail) strip.setPixelColor(secondPixel, color_fade(0xFF0000, bri));
strip.setPixelColor(minutePixel, color_fade(0x00FF00, bri));
strip.setPixelColor(hourPixel, color_fade(0x0000FF, bri));
}


Expand Down

0 comments on commit 22f6128

Please sign in to comment.