Changing the Prompt selection colour #286
-
Hi. The default color for Prompt selection and Multi Selection is a dark blue on a black background when running through command prompt. We are using code from your samples here and here. One of my users has visual issues and it is very difficult for them to read the currently highlighted object. I am looking to change the highlight colour. I've found this issue but HighlightColor or HighlightStyle isn't found. I am guessing it could be in an extension method. Can you please advise. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Look for var highlightStyle = new Style().Foreground(Color.Fuchsia);
var favorites = AnsiConsole.Prompt(
new MultiSelectionPrompt<string>()
.PageSize(10)
.HighlightStyle(highlightStyle)
.Title("What are your [green]favorite fruits[/]?")
.AddChoices(new[]
{
"Apple", "Apricot", "Avocado", "Banana", "Blackcurrant", "Blueberry",
"Cherry", "Cloudberry", "Cocunut", "Date", "Dragonfruit", "Durian",
"Egg plant", "Elderberry", "Fig", "Grape", "Guava", "Honeyberry",
"Jackfruit", "Jambul", "Kiwano", "Kiwifruit", "Lime", "Lylo",
"Lychee", "Melon", "Mulberry", "Nectarine", "Orange", "Olive"
})); |
Beta Was this translation helpful? Give feedback.
-
Versioning might be my issue. I’m running the latest stable release which I think (from memory) was 0.37. I’ll move over to the pre release on Monday and see if that resolves my issue. Thanks for all the hard work. |
Beta Was this translation helpful? Give feedback.
Look for
HighlightStyle
. This was added around the0.37.1-preview.0.10
release I believe to see this property, so make sure you are up to date with the pre-release version