Skip to content

Add system dark mode#1119

Open
amcolash wants to merge 6 commits into
coredevices:mainfrom
amcolash:dark_mode
Open

Add system dark mode#1119
amcolash wants to merge 6 commits into
coredevices:mainfrom
amcolash:dark_mode

Conversation

@amcolash
Copy link
Copy Markdown

@amcolash amcolash commented Apr 19, 2026

Hey pebble friends! I recently started using my pebble again in preparation for my new PT2 arriving soon. I noticed that using the watch at nighttime was really bright and noticed how nice the settings menu w/ black background was. Since PebbleOS is now open source, I decided to try adding in a dark mode. So far is looking really good and will hopefully be a nice feature for people.

Not sure if there are any contribution guidelines I need to keep in mind, but happy to help get this through however you all might think is best. I used claude for portions of the logic, but wrote a significant portion on my own as well. This PR does cover a lot of files, but commits should roughly line up with separate potions of code changes. Happy to split things up if it is too much in one PR though.

Technical Details:

  • There are 3 new helper functions added to src/fw/shell/system_theme.c
    • system_theme_is_dark_mode()
    • system_theme_get_fg_color()
    • system_theme_get_bg_color()
  • The Settings -> Display/Theme page (dependent on theme support, falls back to display) has new options for Dark Mode: Off / On / Auto.
    • Dark mode is turned off by default
    • "Auto" mode uses the ambient light sensor to determine if dark mode should be enabled
    • The settings page order was changed slightly after the screenshot was taken
  • Most of the changes in this PR are changing colors from hardcoded values to the above functions for fg/bg colors.

These changes should be scoped to pebbleos with a check that I think should prevent the default values going to 3rd party apps. If it seems like there is community interest, it should be pretty simple to roll out to application developers later on.

Below are screenshots of many parts of the ui that have been touched. I did a pretty thorough check through all pages and I think it is in a pretty decent spot. The colors are washed in a few from QEMU + backlight dimming.

I still have a little bit of testing on a few more places, but pretty close to ready for merging once approved. Haven't looked too deeply at round/new/etc hardware, but I think a lot of the spots should be decent. Thanks all, love that pebble is back and so happy to be able to contribute! 😁 🪨

Screenshot from 2026-04-19 00-17-05

Screenshot from 2026-04-19 00-17-23

Screenshot from 2026-04-19 00-17-34

Screenshot from 2026-04-19 00-17-45

Screenshot from 2026-04-19 00-18-05

Screenshot from 2026-04-19 00-18-20

Screenshot from 2026-04-19 00-18-46

Screenshot from 2026-04-19 01-22-03

Screenshot from 2026-04-19 01-22-21

@gmarull
Copy link
Copy Markdown
Member

gmarull commented Apr 20, 2026

thanks for the contribution, please, make sure to make changes following contributing guidelines (see other PRs/commits as a reference)

@gmarull gmarull requested review from ericmigi and jplexer April 20, 2026 10:43
Copy link
Copy Markdown
Member

@jplexer jplexer left a comment

Choose a reason for hiding this comment

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

This is awesome, but please, as Gerard said, make the commits fit the guidelines. Thank you!

@amcolash amcolash force-pushed the dark_mode branch 3 times, most recently from a57c3a0 to c1f2878 Compare April 20, 2026 16:01
@amcolash
Copy link
Copy Markdown
Author

amcolash commented Apr 20, 2026

I think I got all of the commits signed off/co-authored now.

Only question I have is if I should move this preference to the "theme" section of the settings menu, or keep it in "display". UX-wise, it makes more sense in theme, but not all devices have the theme section. Any watch can support dark/light mode, but definitely not thoroughly tested on them.

Otherwise, I am feeling pretty good with the state of things. Thanks all!

@jplexer
Copy link
Copy Markdown
Member

jplexer commented Apr 20, 2026

Yes, in "Theme" would be good! I dont remember why we disabled it on some builds (maybe @gmarull can tell more?)

regarding your commits, you gotta change the title as well :( the format is "area: change"

@amcolash amcolash force-pushed the dark_mode branch 4 times, most recently from 01513f0 to 43c7475 Compare April 20, 2026 18:59
@amcolash
Copy link
Copy Markdown
Author

amcolash commented Apr 20, 2026

Sorry about the commit message format! Hopefully it is correct this time 🤞

For the option placement: I added some conditional logic to move the option to the "Theme" menu when applicable and a fall-back to "Display", when CAPABILITY_HAS_THEMING is not set.

@amcolash amcolash force-pushed the dark_mode branch 3 times, most recently from b020276 to 1516500 Compare April 21, 2026 19:22
@gmarull
Copy link
Copy Markdown
Member

gmarull commented Apr 21, 2026

Please, make sure to organize commits properly. We do not allow reverts of something added in the same PR. Just squash things, group them in logical chunks.

@gmarull
Copy link
Copy Markdown
Member

gmarull commented Apr 21, 2026

something's wrong if we have 17 commits and such a small delta:

image

@amcolash
Copy link
Copy Markdown
Author

amcolash commented Apr 22, 2026

Thanks for the commit feedback. I primarily work on repos where the entire PR gets squashed on merge - so order, reverts, etc don't matter much.

I have logically split up the commits by section of the code and each should build on its own. Hopefully this matches what you are looking for.

@amcolash amcolash force-pushed the dark_mode branch 9 times, most recently from d603ba3 to 21d6d6b Compare April 24, 2026 20:11
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrew McOlash <amcolash@gmail.com>
amcolash and others added 2 commits April 24, 2026 22:18
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrew McOlash <amcolash@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrew McOlash <amcolash@gmail.com>
amcolash and others added 3 commits April 24, 2026 22:45
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrew McOlash <amcolash@gmail.com>
Signed-off-by: Andrew McOlash <amcolash@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrew McOlash <amcolash@gmail.com>
@amcolash
Copy link
Copy Markdown
Author

Quick update on my side: I have fixed up the build + test matrix on my local fork!

Copy link
Copy Markdown
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

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

we also need to think about exposing this to apps/watchfaces, so they can also support light/dark mode based on user prefs.

Comment thread src/fw/shell/prefs.h
Comment on lines +216 to +218
#if CAPABILITY_HAS_AMBIENT_LIGHT_SENSOR
DarkModeAuto = 2, // Follows the ambient light sensor; dark mode when ambient light is low
#endif
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd personally remove the auto mode tied to ambient light. I think this makes sense on *LED type displays, where black pixels do not emit or emit less light, but on e-paper, backlight has no relation with the displayed color. So IMHO, it's more an aesthetics preference on e-paper.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I do see your point for actual light emitted. My reasoning for this was not so much about light emitted, but more about legibility. It is usually much easier to read black text, white bg in direct sunshine. At night time, white text on dark bg is easier on eyes plus easier to read for me. Although it might not be for everyone, I do think there is a valid use case here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe it could be time based?

}

bool system_theme_is_dark_mode(void) {
// Dark mode is only supported on color platforms, so treat all non-color platforms as light mode
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dark mode could still be supported on B/W, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes it could definitely be supported on B/W. I have not tested any of this on B/W at all, so this decision was to limit scope of the changes to color watches. We could add it for all devices, but regardless, I think this is very much in a "Beta" position right now.

prv_legacy_app_mode_menu_push((SettingsDisplayData*)context);
break;
#endif
#if !CAPABILITY_HAS_THEMING
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CAPABILITY_HAS_THEMING hides a primitive theming system which this PR seems to improve, can we remove flag entirely, remove dead code and just offer this feature by default?

Copy link
Copy Markdown
Author

@amcolash amcolash Apr 27, 2026

Choose a reason for hiding this comment

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

On all color systems, yes. However, maybe we still need the flag for B/W watches? I suppose there could always be the themes menu and optionally have the "accent color" option on color-only devices.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

#if PBL_BW or #if !PBL_COLOR

@gmarull gmarull requested a review from jplexer April 27, 2026 12:19
Copy link
Copy Markdown
Member

@jplexer jplexer left a comment

Choose a reason for hiding this comment

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

I like this PR, but please look at the comments re: enabling has_theming again + exposing the apis publically

@s00se s00se mentioned this pull request May 24, 2026
1 task
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