clayPanelRaised function

bool clayPanelRaised(
  1. ThemeSpec spec
)

Whether the display panel of spec is the raised pillow: its surface is lighter than the body. GuardrailRule.clayPanel requires it (the recessed tray is retired).

Implementation

bool clayPanelRaised(ThemeSpec spec) {
  final colors = spec.background.colors;
  if (colors.isEmpty) return true;
  return luminanceArgb(spec.palette.surface | 0xFF000000) >
      luminanceArgb(colors.first | 0xFF000000);
}