Commit 1770fc1fcb

1770fc1fcb6aeb7f60b50cb6a30b062f238731ca

parent: ca0b053c5c

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-25 23:53 UTC

Theme pickers: mark low-contrast themes

The Mac and iOS theme pickers say Low contrast beside Solarized Light and
Solarized Dark, whose colours are below 4.5:1 in places.

Ref #221

Layout: unified · split

Changed files (4)
Sources/Orgstar/ThemePickerSection.swift +4 −1 · view
@@ -33,7 +33,10 @@ struct ThemePickerSection: View {
33 private func picker(_ title: LocalizedStringKey, _ appearance: Palette.Appearance, _ selection: Binding<String>) -> some View { 33 private func picker(_ title: LocalizedStringKey, _ appearance: Palette.Appearance, _ selection: Binding<String>) -> some View {
34 Picker(title, selection: selection) { 34 Picker(title, selection: selection) {
35 ForEach(ThemeSpec.palettes(appearance), id: \.id) { palette in 35 ForEach(ThemeSpec.palettes(appearance), id: \.id) { palette in
36 Label { Text(palette.displayName) } icon: { Image(nsImage: Self.swatch(palette)) }.tag(palette.id) 36 Label {
37 // Below 4.5:1 for body text or coloured roles in places.
38 palette.lowContrast ? Text(palette.displayName) + Text(verbatim: " – ") + Text("Low contrast") : Text(palette.displayName)
39 } icon: { Image(nsImage: Self.swatch(palette)) }.tag(palette.id)
37 } 40 }
38 if ThemeSpec.palette(selection.wrappedValue, appearance) == nil { 41 if ThemeSpec.palette(selection.wrappedValue, appearance) == nil {
39 Text(selection.wrappedValue).tag(selection.wrappedValue) 42 Text(selection.wrappedValue).tag(selection.wrappedValue)
Sources/OrgstarMobile/ThemePickerScreen.swift +5 −1 · view
@@ -17,7 +17,11 @@ struct ThemePickerScreen: View {
17 } label: { 17 } label: {
18 HStack { 18 HStack {
19 VStack(alignment: .leading, spacing: 6) { 19 VStack(alignment: .leading, spacing: 6) {
20 Text(palette.displayName).foregroundStyle(.primary) 20 HStack(alignment: .firstTextBaseline) {
21 Text(palette.displayName).foregroundStyle(.primary)
22 // Below 4.5:1 for body text or coloured roles in places.
23 if palette.lowContrast { Text("Low contrast").font(.caption).foregroundStyle(.secondary) }
24 }
21 Self.sample(palette) 25 Self.sample(palette)
22 } 26 }
23 Spacer() 27 Spacer()
docs/manual/guide/13-configuration.org +1 −1 · view
@@ -691,7 +691,7 @@ The default theme has light and dark colors after GitHub's light and dark themes
691 691
692=light-theme= and =dark-theme= choose a built-in theme for each appearance instead (Settings ▸ Appearance ▸ Theme). The light themes are Default, Solarized Light, Gruvbox Light, Modus Operandi, Catppuccin Latte, Tomorrow and Paper; the dark themes are Default, Solarized Dark, Gruvbox Dark, Modus Vivendi, Catppuccin Mocha, Nord, Dracula, Tokyo Night and doom-one. Every one but Default sets every color key, the sidebar, modeline, agenda and accent included. An unknown name, or one of the other appearance, is reported and Default is used. 692=light-theme= and =dark-theme= choose a built-in theme for each appearance instead (Settings ▸ Appearance ▸ Theme). The light themes are Default, Solarized Light, Gruvbox Light, Modus Operandi, Catppuccin Latte, Tomorrow and Paper; the dark themes are Default, Solarized Dark, Gruvbox Dark, Modus Vivendi, Catppuccin Mocha, Nord, Dracula, Tokyo Night and doom-one. Every one but Default sets every color key, the sidebar, modeline, agenda and accent included. An unknown name, or one of the other appearance, is reported and Default is used.
693 693
694In every built-in theme, text in a quieter color (tags, comments, keyword lines, planning lines and drawers, cancelled keywords, priority C, agenda times and categories) reads at 4.5:1 or more on the background, the WCAG AA level for body text. Markup characters, block delimiters and line numbers are dimmer. Solarized Light and Solarized Dark keep Solarized's own colors, which put body text and the colored keywords under 4.5:1 in places. Modus Operandi and Modus Vivendi reach 4.5:1 for every color. 694In every built-in theme, text in a quieter color (tags, comments, keyword lines, planning lines and drawers, cancelled keywords, priority C, agenda times and categories) reads at 4.5:1 or more on the background, the WCAG AA level for body text. Markup characters, block delimiters and line numbers are dimmer. Solarized Light and Solarized Dark keep Solarized's own colors, which put body text and the colored keywords under 4.5:1 in places. The theme pickers on the Mac and in iOS Settings mark them Low contrast. Modus Operandi and Modus Vivendi reach 4.5:1 for every color.
695 695
696You change any of them by setting colors in =config.toml=, or by keeping a theme in its own file. Copy to Config Folder writes the two chosen themes, every color written out, into =my-theme.toml= and sets =theme-file= to it; it leaves an existing =my-theme.toml= as it is. 696You change any of them by setting colors in =config.toml=, or by keeping a theme in its own file. Copy to Config Folder writes the two chosen themes, every color written out, into =my-theme.toml= and sets =theme-file= to it; it leaves an existing =my-theme.toml= as it is.
697 697
l10n/Localizable.xcstrings +35 · view
@@ -20420,6 +20420,41 @@
20420 } 20420 }
20421 } 20421 }
20422 }, 20422 },
20423 "Low contrast": {
20424 "comment": "A theme whose colours are below 4.5:1 in places",
20425 "localizations": {
20426 "de": {
20427 "stringUnit": {
20428 "state": "translated",
20429 "value": "Geringer Kontrast"
20430 }
20431 },
20432 "es": {
20433 "stringUnit": {
20434 "state": "translated",
20435 "value": "Contraste bajo"
20436 }
20437 },
20438 "fr": {
20439 "stringUnit": {
20440 "state": "translated",
20441 "value": "Contraste faible"
20442 }
20443 },
20444 "ja": {
20445 "stringUnit": {
20446 "state": "translated",
20447 "value": "低コントラスト"
20448 }
20449 },
20450 "pt-BR": {
20451 "stringUnit": {
20452 "state": "translated",
20453 "value": "Baixo contraste"
20454 }
20455 }
20456 }
20457 },
20423 "Lower Priority": { 20458 "Lower Priority": {
20424 "comment": "Command title", 20459 "comment": "Command title",
20425 "localizations": { 20460 "localizations": {
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form