toneColor function

String toneColor(
  1. StatTone tone,
  2. PromptTheme theme
)

Returns the ANSI color for a StatTone.

Implementation

String toneColor(StatTone tone, PromptTheme theme) {
  switch (tone) {
    case StatTone.info:
      return theme.info;
    case StatTone.warn:
      return theme.warn;
    case StatTone.error:
      return theme.error;
    case StatTone.accent:
      return theme.accent;
    case StatTone.success:
      return theme.checkboxOn;
    case StatTone.neutral:
      return theme.gray;
  }
}