ansiColorizer function

String ansiColorizer({
  1. required Color color,
  2. required String message,
  3. required AnsiPen ansiPen,
})

Creates an ansi-compatible colored message from the color provided.

Implementation

String ansiColorizer({
  required Color color,
  required String message,
  required AnsiPen ansiPen,
}) {
  final pen = ansiPen
    ..rgb(
      r: color.red / 255,
      g: color.green / 255,
      b: color.blue / 255,
    );
  return pen.write(message);
}