Skip to content

Change text color of selected text#7691

Merged
emilk merged 4 commits intomainfrom
emilk/change-text-color-of-selected-text
Nov 7, 2025
Merged

Change text color of selected text#7691
emilk merged 4 commits intomainfrom
emilk/change-text-color-of-selected-text

Conversation

@emilk
Copy link
Copy Markdown
Owner

@emilk emilk commented Nov 7, 2025

Selected text now gets the color of visuals.selection.stroke.color. This means you can have inverted colors for selected text, like in the new test:
image

It also means the color of selected text in labels matches that of the text color of selected buttons.

@emilk emilk added feature New feature or request visuals Renderings / graphics releated egui labels Nov 7, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 7, 2025

Preview available at https://egui-pr-preview.github.io/pr/7691-emilkchange-text-color-of-selected-text
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

@emilk emilk force-pushed the emilk/change-text-color-of-selected-text branch from 0a34ea6 to 62a76d2 Compare November 7, 2025 13:46
@emilk emilk merged commit fa4cfec into main Nov 7, 2025
46 of 47 checks passed
@emilk emilk deleted the emilk/change-text-color-of-selected-text branch November 7, 2025 14:34
emilk added a commit that referenced this pull request Dec 11, 2025
Selected text now gets the color of `visuals.selection.stroke.color`.
This means you can have inverted colors for selected text, like in the
new test:
<img width="154" height="46" alt="image"
src="https://github.com/user-attachments/assets/2666361d-d7e2-4d50-8e4d-2fcc128f1a81"
/>


It also means the color of selected text in labels matches that of the
text color of selected buttons.
@emilk emilk mentioned this pull request Dec 11, 2025
@KonaeAkira
Copy link
Copy Markdown
Contributor

In the screenshot you posted, it looks like the closing bracket part of of the smiley isn't affected by visuals.selection.stroke.color. That's unintentional, right?

@emilk
Copy link
Copy Markdown
Owner Author

emilk commented Jan 30, 2026

Good catch @KonaeAkira - I should have used more distinctive colors:

Masterchef365 pushed a commit to Masterchef365/egui that referenced this pull request Apr 3, 2026
Selected text now gets the color of `visuals.selection.stroke.color`.
This means you can have inverted colors for selected text, like in the
new test:
<img width="154" height="46" alt="image"
src="https://github.com/user-attachments/assets/2666361d-d7e2-4d50-8e4d-2fcc128f1a81"
/>


It also means the color of selected text in labels matches that of the
text color of selected buttons.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

egui feature New feature or request visuals Renderings / graphics releated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants