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 372992B 176B
data 948B 0B
bss 22536B 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 vkareh force-pushed the battery-icon-colors branch from bfaaffd to b7a6ddc Compare January 13, 2024 14:40
@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 from de3ca3a to 7e86e85 Compare March 18, 2024 12:43
@vkareh vkareh force-pushed the battery-icon-colors branch from 7e86e85 to a238940 Compare March 26, 2024 12:14
@vkareh vkareh force-pushed the battery-icon-colors branch from a238940 to 0178441 Compare April 12, 2024 12:59
@vkareh vkareh force-pushed the battery-icon-colors branch from 0178441 to f5f160f Compare May 13, 2024 14:54
@vkareh vkareh force-pushed the battery-icon-colors branch from f5f160f to b534fa2 Compare June 10, 2024 14:32
@vkareh vkareh force-pushed the battery-icon-colors branch from b534fa2 to a570644 Compare June 19, 2024 15:29
@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 from dfa3c8e to 1353e94 Compare August 22, 2024 15:52
@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 7a27ce7 to f39c176 Compare September 23, 2024 13:04
@vkareh vkareh force-pushed the battery-icon-colors branch from f39c176 to a9aa092 Compare October 3, 2024 12:35
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]>
@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 0999c86 to 0033739 Compare October 28, 2024 14:45
@vkareh vkareh force-pushed the battery-icon-colors branch from 0033739 to 372455e Compare November 4, 2024 20:25
@mark9064 mark9064 added the new feature This thread is about a new feature label Nov 18, 2024
@vkareh vkareh force-pushed the battery-icon-colors branch from 372455e to d063633 Compare November 20, 2024 14:09
@vkareh vkareh force-pushed the battery-icon-colors branch from d063633 to 219128c Compare December 4, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This thread is about a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants