colorFor function

AnsiCode colorFor(
  1. int index
)

A stable colour per service, so a given prefix keeps its colour for the life of the run.

Implementation

AnsiCode colorFor(int index) {
  const palette = [cyan, green, yellow, magenta, blue, red];

  return palette[index % palette.length];
}