If you pass a continuous color scale to a swatches legend, it’s unlikely to do what you expect:

Plot.legend({
legend: "swatches",
color: {
type: "linear"
}
})
You probably want to use a quantize scale instead:

Plot.legend({
color: {
type: "quantize",
scheme: "turbo"
}
})
So, should we throw an error if you pass a continuous scale to a swatches legend?
Ref. #827