Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using brightness in analog clock overlay #3944

Merged
merged 3 commits into from
May 3, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions wled00/overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ void _overlayAnalogClock()
{
_overlayAnalogCountdown(); return;
}
uint8_t brightness = strip.getBrightness();
paspiz85 marked this conversation as resolved.
Show resolved Hide resolved
float hourP = ((float)(hour(localTime)%12))/12.0f;
float minuteP = ((float)minute(localTime))/60.0f;
hourP = hourP + minuteP/12.0f;
Expand All @@ -25,11 +26,11 @@ void _overlayAnalogClock()
{
if (secondPixel < analogClock12pixel)
{
strip.setRange(analogClock12pixel, overlayMax, 0xFF0000);
strip.setRange(overlayMin, secondPixel, 0xFF0000);
strip.setRange(analogClock12pixel, overlayMax, color_fade(0xFF0000, brightness));
strip.setRange(overlayMin, secondPixel, color_fade(0xFF0000, brightness));
} else
{
strip.setRange(analogClock12pixel, secondPixel, 0xFF0000);
strip.setRange(analogClock12pixel, secondPixel, color_fade(0xFF0000, brightness));
}
}
if (analogClock5MinuteMarks)
Expand All @@ -38,12 +39,12 @@ void _overlayAnalogClock()
{
unsigned pix = analogClock12pixel + roundf((overlaySize / 12.0f) *i);
if (pix > overlayMax) pix -= overlaySize;
strip.setPixelColor(pix, 0x00FFAA);
strip.setPixelColor(pix, color_fade(0x00FFAA, brightness));
}
}
if (!analogClockSecondsTrail) strip.setPixelColor(secondPixel, 0xFF0000);
strip.setPixelColor(minutePixel, 0x00FF00);
strip.setPixelColor(hourPixel, 0x0000FF);
if (!analogClockSecondsTrail) strip.setPixelColor(secondPixel, color_fade(0xFF0000, brightness));
strip.setPixelColor(minutePixel, color_fade(0x00FF00, brightness));
strip.setPixelColor(hourPixel, color_fade(0x0000FF, brightness));
}


Expand Down