rgbaToU32 static method

int rgbaToU32(
  1. int r,
  2. int g,
  3. int b,
  4. int a,
)

Implementation

static int rgbaToU32(int r, int g, int b, int a) {
  var u32 = 0;
  if (Endian.host == Endian.little) {
    u32 += (a & 0xff) << 24;
    u32 += (b & 0xff) << 16;
    u32 += (g & 0xff) << 8;
    u32 += r & 0xff;
  } else {
    u32 += (r & 0xff) << 24;
    u32 += (g & 0xff) << 16;
    u32 += (b & 0xff) << 8;
    u32 += a & 0xff;
  }
  return u32;
}