getColor function

int getColor (
  1. int r,
  2. int g,
  3. int b,
  4. [int a = 255]
)

Get the color with the given r, g, b, and a components.

The channel order of a uint32 encoded color is RGBA.

Implementation

int getColor(int r, int g, int b, [int a = 255]) =>
    (clamp255(a) << 24) |
    (clamp255(b) << 16) |
    (clamp255(g) << 8) |
    (clamp255(r));