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 374704B 176B
data 948B 0B
bss 63488B 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.

@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 8dee72a to dfa3c8e Compare August 19, 2024 17:06
@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 7a27ce7 to f39c176 Compare September 23, 2024 13:04
JustScott added a commit to JustScott/InfiniTime that referenced this pull request Oct 3, 2024
+ Reorder code to match the widgets order in the UI.

+ Use InfintimeTheme Colors instead of hardcoded hex values

+ Added a new InfinitimeTheme color: gray, using it to turn certain
  values gray when they contain no data

+ Implement @vkareh's [variable battery icon](InfiniTimeOrg#1964)
  color to the battery percentage text.

+ Replaced the 'You have mail.' notification message with the message
  '[1]+ Notify' to better fit the terminal lore.
JustScott added a commit to JustScott/InfiniTime that referenced this pull request Oct 4, 2024
+ Reorder code to match the widgets order in the UI.

+ Use InfintimeTheme Colors instead of hardcoded hex values

+ Added a new InfinitimeTheme color: gray, using it to turn certain
  values gray when they contain no data

+ Implement @vkareh's [variable battery icon](InfiniTimeOrg#1964)
  color to the battery percentage text.

+ Replaced the 'You have mail.' notification message with the message
  '[1]+ Notify' to better fit the terminal lore.
headblockhead added a commit to headblockhead/InfiniTime that referenced this pull request Oct 4, 2024
* Remove unused pointer to DisplayApp member variables (InfiniTimeOrg#2125)

In the screens that use `DisplayApp *app` and pass it to a child item,
or use the reference just in the constructor. Afterwards the `app`
member is not used. So remove it from the private member variables.

Completely remove `app` parameter from `SettingDisplay` constructor as
it is unused.

* MusicService: add missing includes for TickType_t and xTaskGetTickCount (InfiniTimeOrg#2130)

Add `FreeRTOS.h` include for the directly used data type `TickType_t` in the header
and the function `xTaskGetTickCount` from FreeRTOS's `task.h`

* Improved the Terminal Watchfaces UI

+ Reorder code to match the widgets order in the UI.

+ Use InfintimeTheme Colors instead of hardcoded hex values

+ Added a new InfinitimeTheme color: gray, using it to turn certain
  values gray when they contain no data

+ Implement @vkareh's [variable battery icon](InfiniTimeOrg#1964)
  color to the battery percentage text.

+ Replaced the 'You have mail.' notification message with the message
  '[1]+ Notify' to better fit the terminal lore.

---------

Co-authored-by: NeroBurner <[email protected]>
Co-authored-by: JustScott <[email protected]>
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.

3 participants