colorize function

String colorize(
  1. String text, [
  2. Iterable<TerminalColor> colors = const []
])

Implementation

String colorize(String text, [Iterable<TerminalColor> colors = const []]) {
  for (final color in colors) {
    text = '\x1B[${color.index}m$text';
  }
  return '$text\x1B[0m';
}