glassDiffuseColor function
The colour glass diffuses the background to: the three-way centroid of a mesh's blobs (exactly one of meshHullSamples) — the vivid middle of the mesh — or the base colour for other backgrounds. The renderer's frost underlay and Reduce Transparency's solid tint (the tint composited over it) use it, so both are checked colours.
Implementation
int glassDiffuseColor(BackgroundSpec bg) {
final c = bg.colors;
if (bg.kind == BackgroundKind.meshGradient && c.length >= 4) {
return _centroid(c[1] | 0xFF000000, c[2] | 0xFF000000, c[3] | 0xFF000000);
}
return (c.isEmpty ? 0 : c.first) | 0xFF000000;
}