uint32Int property

int get uint32Int

Quickly generate pixel values in RGBA format through the List collection

Implementation

int get uint32Int {
  int getRGBA(int red, int green, int blue, int alpha) {
    final int r = red & 0x000000ff;
    final int g = (green << 8) & 0x0000ff00;
    final int b = (blue << 16) & 0x00ff0000;
    final int a = (alpha << 24) & 0xff000000;
    return a + r + b + g;
  }

  if (isEmpty || length < 4) {
    return getRGBA(0, 0, 0, 0);
  } else {
    return getRGBA(this[0].clamp(0, 255), this[1].clamp(0, 255),
        this[2].clamp(0, 255), this[3].clamp(0, 255));
  }
}