Skip to content

Tint: accent color for controls - #41

Merged
colemancda merged 4 commits into
masterfrom
feature/tint
Jul 23, 2026
Merged

Tint: accent color for controls#41
colemancda merged 4 commits into
masterfrom
feature/tint

Conversation

@colemancda

Copy link
Copy Markdown
Member

.tint(_:) sets the accent color for controls in a subtree — an environment value, like .foregroundColor.

What's new

  • .tint(_ color:) modifier (emits kind tint).
  • A LocalTint CompositionLocal folded in RenderChild alongside font/color/disabled, so it propagates to the whole subtree.
  • Applied to the controls that honor it: Button (container), Toggle (Switch track), Slider (thumb + active track), ProgressView (indicator).

Verification

  • swift test — new emission test, 65 total passing
  • Emulator (Styling screen, new "Inherited tint" example): a .tint(.pink) container turns its button, toggle, slider, and progress bar all pink; the other inheritance examples are unaffected

Deferred

Tint on Picker/Stepper/DatePicker accent (uses default) and Menu items.

@colemancda
colemancda merged commit ef6def4 into master Jul 23, 2026
6 checks passed
@colemancda
colemancda deleted the feature/tint branch July 23, 2026 18:34
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