Previously with chart.js v2, I could loop through the dataset object within the chart object and find out the default colors that were assigned. I then use these colors to color custom buttons elsewhere on my webpage.
With chart.js v2 I could find the color by looking for this attribute:
chart.datasets[index].borderColor
With chart.js v4, the borderColor attribute is not defined unless I had specifically chosen a color myself when adding the dataset.
I have tried expanding the chart object in the debug console and couldn't see where I would be able to read the auto-assigned chart colors. I am hoping someone can point me in the right direction.
Note, this is part of an angular app, and I am using ng2-charts to load chart.js. I intend to loop through the chart object to find the dataset colors in the html template.
Here is what the chart object looks like with v4: