color() when using .repeat({layer:[...]})

Example notebook here: https://observablehq.com/@kpm-at-hfi/color-when-using-repeat-layer

I’d like each layer to have it’s own color, but instead I’m either getting only one color for everything, or getting individual colors for the data in those layers.

I know this is just a silly syntax thing… help please?

Whelp, again all I had to do was ask publicly.

The answer is vl.color().datum(vl.repeat("layer")) and not vl.color().fieldN(vl.repeat("layer")).