skiptools / skiptools/skip-ui

Incorrect Selection of Primary Color on Android

Open
#231 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

appearance compose
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.
Image

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.
Image

Taking a look at the Gmail app confirms that the foreground style should actually be light on a dark accent color background.
Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.