Ordinal colour scale with opacity

Hi everyone,

Is it possible to add a transparency to a colour scale? In the example below, I want the resulting colours not at 100% transparency but e.g. at 30%.


Many thanks!

A simple way to make some colors transparent is to write them as 8 digit hex codes #RRGGBBAA.

Since d3.schemeTableau10 is already 6-digit hex codes, you can do a 50% opacity like so:

d3.schemeTableau10.map(d => `${d}80`)