getColor static method

PdfColor getColor(
  1. int index
)

Get a pseudo-random color

Implementation

static PdfColor getColor(int index) {
  final hue = index * 137.508;
  final PdfColor color = PdfColorHsv(hue % 360, 1, 1);
  if ((index / 3) % 2 == 0) {
    return PdfColor.fromRYB(color.red, color.green, color.blue);
  }
  return color;
}