bauhausSceneSamples function

List<int>? bauhausSceneSamples(
  1. BackgroundSpec bg
)

Guardrail background samples of the scene: the ground, plus the grid field when there is one. Nothing else is ever painted under a key, label, focus ring, toolbar control (icons and the mode button) or display text (the scene keeps its shapes in the toolbar's free middle, clear of the mode button, and in the screen margins).

Implementation

List<int>? bauhausSceneSamples(BackgroundSpec bg) {
  if (bg.colors.isEmpty) return const [0xFF000000];
  final ground = bg.colors[0] | 0xFF000000;
  final field = bg.colors.length > 1 ? bg.colors[1] | 0xFF000000 : ground;
  return field == ground ? [ground] : [ground, field];
}