Here is the code taken from the Altair documentation on color schemes.
alt.Chart(iris).mark_point().encode(
x='petalWidth',
y='petalLength',
color=alt.Color('species', scale=alt.Scale(scheme='dark2'))
)
Here, to color based on species, they used the dark2 color scheme. There are 8 colors in the dark2 vega scheme. I have noticed that when there more categories than colors available, it appears that the colors are recycled again, which means some categories have the same color. In this example, suppose species had more than 8 categories. This means two species will be colored in the same way.
Is there anyway to within Altair to automatically 'extend' the dark2 color scheme to support more categories? I was thinking something along the lines of interpolation or mixing colors in the scheme.
As a side note, I'm aware that there are other color schemes with more colors available, but I would like to have a solution which I mentioned above with dark2.