Skip to content

Deprecate the label and standard system colors on Color - #34

Open
Jeehut wants to merge 2 commits into
mainfrom
wip/deprecate-system-colors
Open

Jeehut wants to merge 2 commits into
mainfrom
wip/deprecate-system-colors

Conversation

@Jeehut

@Jeehut Jeehut commented Nov 21, 2026

Copy link
Copy Markdown
Member

HandySwiftUI's Color.label, Color.secondaryLabel … Color.quaternaryLabel and Color.systemBlue … Color.systemGray6 only repeat colors that SwiftUI offers directly today (.primary, .secondary, .blue, .gray, …). These 19 helpers are now deprecated, each with a message naming its SwiftUI replacement; they still work. The package's own views and the DocC page use the SwiftUI colors now.

Background, fill, separator, placeholder and link colors stay as they are: SwiftUI has no direct replacement for them.

Considered: removing the helpers in 3.0.0. Deprecating first gives callers a warning with the replacement instead of a build error.

iPhone 17 on the branch, light and dark. The same screen on main renders pixel for pixel the same (0 of 3,162,132 pixels differ in each appearance): MultiSelectionView option text, the vertical LabeledContent key, the cb text tag, and the blue preview color.

Light Dark
MultiSelectionView, vertical LabeledContent, the cb text tag and a blue swatch in light mode The same screen in dark mode

How this was verified

  • swift test --build-system swiftbuild: 40 tests in 13 suites passed, no deprecation warning from Sources/. Built for iOS, tvOS, watchOS and visionOS with xcodebuild.
  • The screen above was rendered from main and from the branch on an iPhone 17 simulator (iOS, Dynamic Type L) and compared pixel by pixel.
  • The 12 direct replacements were compared numerically on macOS in light and dark mode; all matched within 0.001.
  • Not checked: rendered macOS, tvOS, visionOS and watchOS views, increased contrast. Review: Code ✓ · Design – · QA ✓

Door two-way · Blast Radius breit (public API, re-exported by FlineDevKit; callers get deprecation warnings)

SwiftUI has its own adaptive colors for these now: Color.primary and
Color.secondary for labels, the .tertiary and .quaternary shape styles,
and Color.blue, .green and so on for the standard system colors. Mark
the 19 static properties as deprecated with a message that names the
replacement. They stay available in 3.0.0.

The background, fill, separator, link and placeholder colors have no
SwiftUI counterpart and stay as they are. The library's own views and
the documentation use the SwiftUI colors now, so the package itself
emits no deprecation warnings.
The preview at the end of ColorExt.swift and two comments still used
the now deprecated Color.systemBlue, so the package emitted its own
deprecation warnings. Use Color.blue there instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant