vaporwaveKeyMixSamplesOf function

List<int> vaporwaveKeyMixSamplesOf(
  1. List<int> stops
)

The in-between colours a key can sit over: the grid at alpha k / 8 (k = 1…7) over each floor sample and over the horizon haze, plus the haze itself. The painter really draws them behind the top key rows: the far end of every floor ray and the far cross lines fade in with alpha, the haze fades out, and every line has anti-aliased edges. Midway between a dark floor and a bright grid neither a warm face nor the dark ink reaches 3:1, so the boundary rule counts the key's outer bevel highlight there (vaporwaveBevelHighlight).

Implementation

List<int> vaporwaveKeyMixSamplesOf(List<int> stops) {
  final s = [for (final c in stops) c | 0xFF000000];
  final haze = compositeOver(withAlpha(s[9], vaporwaveHazeAlpha), s[6]);
  final floors = [
    s[6],
    s[7],
    for (var k = 1; k <= 3; k++) _mix(s[6], s[7], 4 - k, k, 4),
    haze,
  ];
  return [
    for (final f in floors)
      for (var k = 1; k <= 7; k++) _mix(s[8], f, k, 8 - k, 8),
    haze,
  ];
}