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

BatteryIcon: Change color with charge percentage #1964

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vkareh
Copy link
Contributor

@vkareh vkareh commented Jan 13, 2024

Silly little change to dynamically color the battery based on the charge left.

battery

Copy link

github-actions bot commented Jan 13, 2024

Build size and comparison to main:

Section Size Difference
text 377672B 176B
data 940B 0B
bss 63540B 0B

@minacode
Copy link
Contributor

minacode commented Jan 13, 2024

Nice idea, I like it a lot! 😊
I think you could improve the contrast a little by using HSV colors and mapping the percentage to the hue interval between red and green.
The brown in the second picture would become yellow.
Lvgl can do the conversion to RGB.

@vkareh
Copy link
Contributor Author

vkareh commented Jan 13, 2024

@minacode That's a brilliant suggestion! I've updated the code and added a new screenshot - looks way better, thanks!

@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 9eaf40e to 8e61a5d Compare January 16, 2024 21:50
@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 7083ce0 to a850f49 Compare January 24, 2024 15:32
@vkareh vkareh force-pushed the battery-icon-colors branch 3 times, most recently from ec452d0 to 20a0843 Compare February 12, 2024 15:13
@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 559832f to de3ca3a Compare February 19, 2024 01:09
@z3t0
Copy link

z3t0 commented Mar 1, 2024

I love this change. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants