paperPanelSamples function

List<int> paperPanelSamples(
  1. int panel,
  2. BackgroundSpec bg, {
  3. required bool accessible,
})

The display panel's colours under text: panel with the panel grain (half the sheet's) and, outside the Accessible lock, the feint rules over each.

Implementation

List<int> paperPanelSamples(
  int panel,
  BackgroundSpec bg, {
  required bool accessible,
}) {
  final g = paperGrainOf(bg) * paperFaceGrainPermille ~/ 1000;
  final bases = paperGrainBases(panel, g);
  if (accessible || bg.colors.length < 2) return bases;
  final rule = bg.colors[1] | 0xFF000000;
  return [
    ...bases,
    for (final b in bases)
      compositeOver(withAlpha(rule, paperDisplayRuleAlpha), b),
  ];
}