setRgb method
Set the RGB color of a palette entry at index. If the palette has fewer
channels than are set, the unsupported channels will be ignored.
Implementation
@override
void setRgb(int index, num r, num g, num b) {
  index *= numChannels;
  data[index] = r.toInt();
  if (numChannels > 1) {
    data[index + 1] = g.toInt();
    if (numChannels > 2) {
      data[index + 2] = b.toInt();
    }
  }
}