Incorrect Selection of Primary Color on Android
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
Depending on the color scheme defined in the device settings, the default color of button icons may be wrong.
Given some structure:
HStack {
Text("Website")
Image(systemName: "arrow.up.right")
#if SKIP
.font(Font.system(size: 10))
#endif
}
it seems like the color of the icon is incorrectly assumed to always be the same color as normal body text.
However, this is not always true:
Note: I'm not sure whether the button background color is actually called accent color, but for a lack of better knowledge I'll go with accent color
Situation 1 - color scheme with light accent color:
Contrast is good, text and icons are readable.
Situation 2 - color scheme dark accent color (in this case the Samsung-provided default option):
Contrast is good for text but bad for icons, text is readable, icons not so much.
Taking a look at the Gmail app confirms that the foreground style should actually be light on a dark accent color background.
Using .foregroundStyle(.primary) does not help as .primary seems to be mapped to the body text color.
This issue seems to have come up when updating my device to One UI 7.0. This also affects the Skip Showcase app.
Context: Galaxy A55 5G (Android 15, One UI 7.0), Skip libraries updated to the latest versions as of creating this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in the Skip Showcase app using the shown SwiftUI HStack on Android 15 with One UI 7.0, testing light and dark accent-color schemes. Trace how button icon foreground colors are selected and verify completion when icons maintain readable contrast against both accent backgrounds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100