How to replace Color32::PLACEHOLDER
in WidgetText
with a different color?
#6845
Unanswered
FireFragment
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm creating a widget with text inside of it and I want the text to have a certain color (let's say red for example) by default, but I also want to allow users to override the text color, so I want accept the text in form of
impl Into<WidgetText>
:But in this case, it seems I can't override the color to be red by default (ie. replacing
Color32::PLACEHOLDER
withColor32::RED
)The following code overrides the text to be red, but users of my widget can't customize it to a different color:
Documentation at https://docs.rs/egui/latest/egui/widget_text/enum.WidgetText.html mentions this:
But doesn't explain how to replace
Color32::PLACEHOLDER
when I'm the one writing a widget.Is it possible to override
Color32::PLACEHOLDER
with a different color? If not, is it planned / should I open a feature request in issues?Thanks for maintaining this awesome library! :)
Beta Was this translation helpful? Give feedback.
All reactions