You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/runtime/system-color.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ fun App() {
24
24
// Build a dynamic color scheme from the system accent
25
25
darkColorScheme(primary = accentColor)
26
26
} else {
27
+
// null = unsupported platform or macOS multicolor mode
27
28
darkColorScheme()
28
29
}
29
30
) {
@@ -32,6 +33,9 @@ fun App() {
32
33
}
33
34
```
34
35
36
+
!!! note "macOS Multicolor Mode"
37
+
On macOS, when the user selects **Multicolor** in System Settings → Appearance → Accent color, each app is expected to use its own default color. In this case, `systemAccentColor()` returns `null` so your app can fall back to its own brand color or a default palette.
38
+
35
39
### Check Support
36
40
37
41
Use `isSystemAccentColorSupported()` to check platform support before entering a composable context — useful for feature gating or conditional UI:
@@ -98,15 +102,15 @@ The Nucleus example app uses this exact approach — you can test it by running:
98
102
99
103
| Function | Returns | Description |
100
104
|----------|---------|-------------|
101
-
|`systemAccentColor()`|`Color?`| Composable. Returns the current system accent color, or `null` if unsupported. Recomposes on change. |
105
+
|`systemAccentColor()`|`Color?`| Composable. Returns the current system accent color, or `null` if unsupported or if the OS is in multicolor mode (macOS). Recomposes on change. |
102
106
|`isSystemInHighContrast()`|`Boolean`| Composable. Returns `true` if the OS is in high contrast / increased contrast mode. Recomposes on change. |
103
107
|`isSystemAccentColorSupported()`|`Boolean`| Non-composable. Returns whether the current platform supports accent color detection. |
104
108
105
109
## Platform Detection Methods
106
110
107
111
| Platform | Accent Color | High Contrast | Reactive |
Copy file name to clipboardExpand all lines: system-color/src/main/resources/META-INF/native-image/io.github.kdroidfilter/nucleus.system-color/reachability-metadata.json
0 commit comments