clayFocusShadowSamples function
Every colour the focus ring can cross where it runs over a key's own drop shadow: each key group's shadow at clayFocusShadowPermille of its alpha over each of clayFocusShadowBackdrops (40 colours). The generator, the validator and the repair share it.
Implementation
List<int> clayFocusShadowSamples(Palette p, List<int> colors) {
final backs = clayFocusShadowBackdrops(colors);
return [
for (final k in [p.digit, p.operator, p.equals, p.function])
for (final x in backs)
compositeOver(
withAlpha(
k.edge,
(((k.edge >>> 24) & 0xFF) * clayFocusShadowPermille + 500) ~/ 1000,
),
x,
),
];
}