setRgb method
Set the individual r, g, b channels of the color.
Implementation
@override
void setRgb(num r, num g, num b) {
  data[_index] = r.toDouble();
  if (numChannels > 1) {
    data[_index + 1] = g.toDouble();
    if (numChannels > 2) {
      data[_index + 2] = b.toDouble();
    }
  }
}