Skip to content

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 380324B 192B
data 944B 0B
bss 22544B 0B

Run in InfiniEmu

@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.
@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
@vkareh vkareh force-pushed the battery-icon-colors branch from 219128c to 8445990 Compare December 16, 2024 15:41
@vkareh vkareh force-pushed the battery-icon-colors branch from 8445990 to fa0eaab Compare January 6, 2025 14:24
@vkareh vkareh force-pushed the battery-icon-colors branch from fa0eaab to 640ece5 Compare January 29, 2025 18:25
JustScott added a commit to JustScott/InfiniTime that referenced this pull request Jan 30, 2025
+ 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.
@vkareh vkareh force-pushed the battery-icon-colors branch from 640ece5 to a8204e0 Compare February 28, 2025 14:38
BurninTurtles pushed a commit to BurninTurtles/InfiniTimeBT that referenced this pull request Mar 3, 2025
+ 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.
BurninTurtles pushed a commit to BurninTurtles/InfiniTimeBT that referenced this pull request Mar 3, 2025
+ 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.
BurninTurtles pushed a commit to BurninTurtles/InfiniTimeBT that referenced this pull request Mar 3, 2025
+ 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.
BurninTurtles pushed a commit to BurninTurtles/InfiniTimeBT that referenced this pull request Mar 3, 2025
+ 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.
@vkareh vkareh force-pushed the battery-icon-colors branch from a8204e0 to 2e0b92f Compare May 14, 2025 14:21
@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 9071904 to d030d75 Compare May 30, 2025 16:31
@NeroBurner NeroBurner added this to the 1.16.0 milestone May 30, 2025
@mark9064
Copy link
Member

Could I suggest a colour curve such as -e^{-4x}+1 (where x is the battery between 0 and 1)? This way it only starts tinting yellow around 25% ish and is fully yellow around 15%

@vkareh vkareh force-pushed the battery-icon-colors branch from d030d75 to 1d44bce Compare June 4, 2025 17:18
@L3br4nd L3br4nd mentioned this pull request Jun 5, 2025
1 task
@vkareh vkareh force-pushed the battery-icon-colors branch 2 times, most recently from 9a324fb to 1ed7ab4 Compare June 19, 2025 17:49
JustScott added a commit to JustScott/InfiniTime that referenced this pull request Jun 20, 2025
+ Reorder code to match the widgets order in the UI.

+ Moved all objects (rows) into a container

+ 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 Jun 21, 2025
+ Reorder code to match the widgets order in the UI.

+ Moved all objects (rows) into a container

+ 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.
@vkareh vkareh force-pushed the battery-icon-colors branch from 1ed7ab4 to 6942e88 Compare June 30, 2025 14:20
JustScott added a commit to JustScott/InfiniTime that referenced this pull request Jul 29, 2025
+ Reorder code to match the widgets order in the UI.

+ Moved all objects (rows) into a container

+ 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.
@vkareh vkareh force-pushed the battery-icon-colors branch from 6942e88 to 587d3a3 Compare July 31, 2025 12:36
JustScott added a commit to JustScott/InfiniTime that referenced this pull request Aug 22, 2025
+ Reorder code to match the widgets order in the UI.

+ Moved all objects (rows) into a container

+ 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.
@vkareh vkareh force-pushed the battery-icon-colors branch from 587d3a3 to 859dd5e Compare October 3, 2025 16:07
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.

5 participants