faceSamples function

List<int> faceSamples(
  1. int face,
  2. List<int> backgrounds
)

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)];