I would like to extract the colors (i.e., obtain RGBColor[]
or other full specification) of the different colors used in a bar chart such as this
BarChart[{{4, 4, 1, 0.05}, {3, 3, 1, 1}, {1, 1, 2, 2}, {2, 2, 4, 4}}]
for use in other figures, text and such. I've tried Options[BarChart]
and AbsoluteOptions[...]
and found only that the options are Automatic
. I have also looked at a number of other posted problems focusing on extracting specific numerical Option
values when the value is Automatic
and none yield the answer. Likewise controlling colors in BarChart
is straightforward and not the problem I'm addressing.
Union@Cases[BarChart[....], _RGBColor, Infinity]
is a first step ... $\endgroup$ColorData[97]
. $\endgroup$ColorData[97]
? $\endgroup$