useColors property

bool useColors
getter/setter pair

Whether ANSI colors are emitted to the terminal.

Automatically disabled when stdout is not a terminal (piped output, CI log capture) or when NO_COLOR is set.

Implementation

static bool useColors = stdout.supportsAnsiEscapes &&
    !Platform.environment.containsKey('NO_COLOR');