Skip to content

Changing the Prompt selection colour #286

Answered by phil-scott-78
cfelstead asked this question in Q&A
Discussion options

You must be logged in to vote

Look for HighlightStyle. This was added around the 0.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

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", "Honey…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@cfelstead
Comment options

Answer selected by cfelstead
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants