skiptools / skiptools/skip-ui

`assetAccentColor` doesn't search for `AccentColor` in my module's bundle

Open
#431 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
330
Forks
76
Avg merge
3h 6m
Merged PRs (30d)
1

Description

https://github.com/skiptools/skip-ui/blob/2f7c8e2f4f1dc8d7a8e6e1463fc50c8e1f6be36b/README.md?plain=1#L2575-L2579

Accent Color

In addition to programmatically using SwiftUI's .tint modifier, iOS allows you to set your application's accent color via the AccentColor resource in your app's Assets asset catalog. In a Skip app, you can find Assets in the Darwin folder.

Skip also supports these mechanisms, but your generated Android app can't access the Darwin folder contents. To define an accent color resource for your Android app, create a color set called AccentColor in the Sources/<YourAppModule>/Resources/Module asset catalog. See the section on Named Colors below for additional details.

Sounds great, but there's just one problem:

https://github.com/skiptools/skip-ui/blob/2f7c8e2f4f1dc8d7a8e6e1463fc50c8e1f6be36b/Sources/SkipUI/SkipUI/Color/Color.swift#L193-L200

We're not searching my module's bundle. We're searching Bundle.main, the bundle that isn't transpiled.

This code can find an accent color if you manually install one in your main bundle, but if you follow the documented instructions to put an AccentColor in your module bundle, this code will never find it.

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

Read the Accent Color guidance in README.md around lines 2575-2579, then inspect Sources/SkipUI/SkipUI/Color/Color.swift around lines 193-200. Trace how the accent color bundle is selected and verify the lookup uses the module bundle described by the documentation. Done means an AccentColor resource in Sources//Resources/Module can be found by assetAccentColor without manually installing it in the main bundle.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.