Pure function that samples flat RGBA pixel bytes ([r, g, b, a, ...]) and returns up to
maxColors (at most 5) distinct hex colors suitable for a Brand Kit palette.
Transparent pixels (a < 128) are ignored. Opaque pixels are quantized into RGB buckets,
ranked by frequency, and filtered by minimum perceptual distance so the returned swatches
are visually distinct.
Pure function that samples flat RGBA pixel bytes (
[r, g, b, a, ...]) and returns up tomaxColors(at most 5) distinct hex colors suitable for a Brand Kit palette.Transparent pixels (
a < 128) are ignored. Opaque pixels are quantized into RGB buckets, ranked by frequency, and filtered by minimum perceptual distance so the returned swatches are visually distinct.