Wire up dark mode across all Apple frontends (RFC 0007)#12
Closed
willwade wants to merge 1 commit into
Closed
Conversation
Bumps DasherCore to e8e394b5 which adds: - 8 dark companion palette XML files (Default Dark, Rainbow Dark, etc.) - C API: dasher_set_appearance, dasher_get_palette_appearance, dasher_find_companion_palette - ColorIO/ColorPalette changes for appearance+companion metadata - Bidirectional companion lookup for legacy palettes Frontend integration (this commit): - DasherBridge.setAppearance(dark:) added to all 4 bridges (DasherApp, DasherMac, DasherVision, DasherKeyboard) - DasherApp (iOS): @Environment(\.colorScheme) + onChange calls setAppearance on appear and when system theme flips - DasherMac: same @Environment(\.colorScheme) pattern - DasherVision: forced dark (visionOS is always dark mode) - DasherKeyboard: traitCollectionDidChange + viewWillAppear When the OS switches between light and dark, each frontend calls dasher_set_appearance(ctx, DARK/LIGHT). If the current palette has a companion, DasherCore switches to it; if not (e.g. 'Yellow on Blue' which is already dark), it returns -1 and the palette is left unchanged — the user's explicit choice is respected. Dark palettes inherit their parent's letter/group fills and override only the chrome (background, labels, outlines, crosshair, info/warning boxes), so the canvas identity stays consistent across appearances. Signed-off-by: will wade <willwade@gmail.com>
Contributor
Author
|
Superseded by the stateful appearance model in DasherCore #25. Will open a new PR using the new API (dasher_set_appearance_mode / dasher_set_system_appearance / dasher_set_user_palette). |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires up dark mode across all four Apple frontends using the DasherCore appearance-aware palette system (RFC 0007, merged in DasherCore #24).
DasherCore bump
581093ef→e8e394b5— pulls in:dasher_set_appearance,dasher_get_palette_appearance,dasher_find_companion_paletteFrontend integration
Bridge layer
Added
setAppearance(dark: Bool)to all 4DasherBridgecopies (DasherApp, DasherMac, DasherVision, DasherKeyboard). Callsdasher_set_appearance(ctx, dark ? 2 : 1). Returns silently if no companion exists.Per-platform wiring
@Environment(\.colorScheme)+.onChangeinContentView@Environment(\.colorScheme)+.onChangeinMacContentView.onAppear { setAppearance(dark: true) }— visionOS is always darktraitCollectionDidChange+viewWillAppearinKeyboardViewControllerHow it works
When the OS switches between light and dark:
bridge.setAppearance(dark: ...)dasher_set_appearance(ctx, appearance)Dark palettes inherit their parent's letter/group fills and override only chrome colours (background, labels, outlines, crosshair). Canvas identity stays consistent; only the background flips.
Testing checklist