Skip to content

Add accent color API support - #887

Merged
Kyle-Ye merged 6 commits into
mainfrom
feature/accent_color
May 31, 2026
Merged

Add accent color API support#887
Kyle-Ye merged 6 commits into
mainfrom
feature/accent_color

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented May 31, 2026

Copy link
Copy Markdown
Member

Agent Summary

Add accent color API coverage and macOS system accent plumbing.

What Changed

  • Added accent color environment support, including default accent provider hooks, system accent value storage, and catalog-backed resolution.
  • Added Appearance and CoreUISystemCatalogColorName support used by appearance asset lookups and appearance catalog shape styles.
  • Wired the OpenSwiftUI platform environment to use the default accent provider and macOS system accent value provider.
  • Added the macOS accent provider mapping from system accent values to catalog color names, including multicolor and hardware fallbacks.

Validation

  • swift build --target OpenSwiftUICore
  • swift build --target OpenSwiftUI

@github-actions github-actions Bot added area: data-flow State, binding, environment, preference, observation, or property data flow. area: graphics Color, shape, gradient, image, symbols, and graphics primitives. platform: macOS macOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability. labels May 31, 2026
@Kyle-Ye
Kyle-Ye marked this pull request as ready for review May 31, 2026 11:15
@augmentcode

augmentcode Bot commented May 31, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds initial accent color API support to OpenSwiftUI, including environment plumbing and macOS system accent integration.

Changes:

  • Introduces Color.accentColor plus an accentColor environment value, and adds a deprecated View.accentColor(_:) modifier for API compatibility.
  • Adds default accent provider hooks (DefaultAccentColorProvider) and system accent value/provider infrastructure (SystemAccentValue).
  • Wires platform environment configuration to install the default accent provider, and installs a macOS system accent provider.
  • Adds macOS Appearance/_ResolvedAppearance scaffolding to support catalog-backed appearance lookups.
  • Introduces CoreUISystemCatalogColorName and an appearance-backed shape style for resolving CoreUI system catalog colors.
  • Updates tint fallback behavior to use Color.accentColor instead of the prior placeholder.

Technical Notes: macOS accent mapping supports multicolor and hardware accent fallbacks; non-macOS platforms currently default to blue until further system wiring is implemented.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread Sources/OpenSwiftUI/Data/Environment/PlatformEnvironment.swift
@Kyle-Ye
Kyle-Ye force-pushed the feature/accent_color branch from 76edca4 to 4c8a8f1 Compare May 31, 2026 14:04
@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 3.88889% with 173 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.72%. Comparing base (2c0c72a) to head (4c8a8f1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...e/Graphic/Color/CoreUISystemCatalogColorName.swift 0.00% 52 Missing ⚠️
...es/OpenSwiftUICore/Graphic/Color/AccentColor.swift 8.16% 45 Missing ⚠️
...penSwiftUICore/Graphic/Appearance/Appearance.swift 0.00% 33 Missing ⚠️
...SwiftUI/Graphic/Color/KitAccentColorProvider.swift 0.00% 29 Missing ⚠️
...tUICore/Graphic/Appearance/CatalogAppearance.swift 0.00% 12 Missing ⚠️
...es/OpenSwiftUI/View/Toggle/SwitchToggleStyle.swift 0.00% 1 Missing ⚠️
Sources/OpenSwiftUICore/Shape/Tint.swift 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #887      +/-   ##
==========================================
- Coverage   26.81%   26.72%   -0.10%     
==========================================
  Files         682      686       +4     
  Lines       47622    47796     +174     
==========================================
+ Hits        12771    12773       +2     
- Misses      34851    35023     +172     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye Kyle-Ye changed the title Add OpenSwiftUI accent color API support Add accent color API support May 31, 2026
@Kyle-Ye
Kyle-Ye merged commit 60a2593 into main May 31, 2026
6 of 8 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/accent_color branch May 31, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: data-flow State, binding, environment, preference, observation, or property data flow. area: graphics Color, shape, gradient, image, symbols, and graphics primitives. platform: macOS macOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant