Pack (r, g, b[, a]) channels into a single integer key.
RGB are 0-255. Alpha is 0-1 (CSS convention); divide canvas byte-alpha by 255 before passing.
Without alpha: 24-bit RGB. With alpha: 32-bit RGBA (forced unsigned).
Useful for fast per-pixel lookups: cheaper than building a hex string.
Pack
(r, g, b[, a])channels into a single integer key. RGB are 0-255. Alpha is 0-1 (CSS convention); divide canvas byte-alpha by 255 before passing. Without alpha: 24-bitRGB. With alpha: 32-bitRGBA(forced unsigned). Useful for fast per-pixel lookups: cheaper than building a hex string.