Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

StyleF

StyleF sets the style for all values using a function.

carapace.ActionValues(
	"one",
	"two",
	"three",
).StyleF(func(s string, sc style.Context) string {
	switch s {
	case "one":
		return style.Green
	case "two":
		return style.Red
	default:
		return style.Default
	}
})