Skip to content

UptimeRobot: colorize percentage to work with both dark and light bg#2071

Open
huyz wants to merge 3 commits into
wtfutil:trunkfrom
huyz:feature/uptimerobot-colorize-percentage
Open

UptimeRobot: colorize percentage to work with both dark and light bg#2071
huyz wants to merge 3 commits into
wtfutil:trunkfrom
huyz:feature/uptimerobot-colorize-percentage

Conversation

@huyz
Copy link
Copy Markdown
Contributor

@huyz huyz commented May 5, 2026

The problem is that right now UptimeRobot shows uptime percentages in gray, which actually show up as black
when I have a dark background, making it tough to read.

I figured we might as well color-code the percentages, just as it's done for the Charge field
of the Power module, which makes the text readable on light and dark background.

Copilot AI review requested due to automatic review settings May 5, 2026 18:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the UptimeRobot widget so uptime percentages are colorized instead of rendered in gray, aligning that display with the codebase’s other percentage-based widgets and improving readability on different backgrounds.

Changes:

  • Added a dedicated ColorizeUptimePercent helper with uptime-specific thresholds.
  • Updated the UptimeRobot widget to render uptime values with inline colors.
  • Refactored uptime string formatting to split, parse, and rebuild each uptime segment before display.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
utils/colors.go Adds a new utility for colorizing uptime percentages with stricter thresholds near 100%.
modules/uptimerobot/widget.go Switches UptimeRobot uptime rendering from gray text to per-value colored output and rewrites uptime formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/uptimerobot/widget.go Outdated
Comment thread utils/colors.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants