faceSamples function
The opaque colours a key face is seen as (composited over each background sample when translucent).
Implementation
List<int> faceSamples(int face, List<int> backgrounds) =>
((face >>> 24) & 0xFF) == 255
? [face]
: [for (final b in backgrounds) compositeOver(face, b)];