accentHue method

int? accentHue(
  1. Rng r,
  2. int index
)

The steered operator (index 0) or = (index 1) hue (tenths), drawn from r; null when the intent names no accent colour, or names a harmony (which then places the accents).

Implementation

int? accentHue(Rng r, int index) {
  final v = r.nextU32();
  if (intent.harmony != null || intent.colors.length < 2) return null;
  final c = index == 0 || intent.colors.length < 3
      ? intent.colors[1]
      : intent.colors[2];
  if (c.neutral) return null;
  return _pick(_HueRange(c.loTenths, c.hiTenths), v);
}