pub fn should_color(choice: ColorChoice, is_tty: bool) -> boolExpand description
Determine whether ANSI colors should be emitted given the user’s choice and whether stdout is currently a TTY.
This is a pure function that can be tested without side-effects.
choice | is_tty | result |
|---|---|---|
Always | any | true |
Never | any | false |
Auto | true | true |
Auto | false | false |