Skip to content

feat(text_field): macOS-like selection color, selectionColor parameter - #596

Open
botty87 wants to merge 1 commit into
macosui:devfrom
botty87:feat/selection-color
Open

botty87 wants to merge 1 commit into
macosui:devfrom
botty87:feat/selection-color

Conversation

@botty87

@botty87 botty87 commented Nov 5, 2026

Copy link
Copy Markdown

The selection highlight of MacosTextField is the accent color at 20% opacity. In the dark appearance it is hard to tell what is selected.

Change: the default is now an opaque tint of the accent, close to the color macOS paints behind selected text (NSColor.selectedTextBackgroundColor): lerp(white, accent, 0.3) in the light appearance and lerp(#5A5A5A, accent, 0.3) in the dark one. With the blue accent these give #B3D7FF (the system value) and about #3F638B. The accent is the same one the cursor already uses (AccentColorListener, falling back to the theme's primaryColor). A new selectionColor parameter overrides the default.

This is an appearance change, so I kept it separate from the shift-click fix; happy to adjust the values or make it opt-in.

Tests: the default is opaque in both appearances and darker in the dark one; selectionColor overrides it.

Pre-launch Checklist

  • I have incremented the package version as appropriate and updated CHANGELOG.md with my changes (2.3.0: new parameter)
  • I have added/updated relevant documentation
  • I have run "optimize/organize imports" on all changed files
  • I have addressed all analyzer warnings as best I could

🤖 Generated with Claude Code

The selection highlight was the accent color at 20% opacity, hard to read
in the dark appearance. It is now an opaque tint of the accent, close to
NSColor.selectedTextBackgroundColor: with the blue accent #B3D7FF in the
light appearance and about #3F638B in the dark one. The new
selectionColor parameter overrides it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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