Different gradients of a color for each column of a stacked bar chart


I looked at the documentation, but I can’t find any reference to fix my problem…

I have a stacked bar chart, and I would like to have each column of a certain colour (e.g. red for the first column, green for the second column etc…), but with each element of the column being of a gradient of the said colour (e.g. within the first column, one element would be light red, another would be dark red etc…).

It doesn’t matter if the colour gradients are continuous or discrete within each column.

To illustrate what I want, it should be something like that:

Do I have to manually assign a colour for each element, or is there a built-in method I have missed?

Thanks a lot in advance for any information about how to achieve that.

There is no built-in way to do this. I created some util functions that do something similar and that you may be able to re-use in this Plotly PR.