I'm using Ruleplot[] to plot the rules of my cellular automota. I'm using multiple 'colors' (= number of states $k$ ) and I want to color them a different color than the default grayscale. The documentation says to use ColorRules. In ColorRules I found that if no rules are found ColorFunction is used as default. I want to use ColorFunction -> "Rainbow"
but when I try it I get an error.
RulePlot[CellularAutomaton[{5^3, 5, {1, 1}}], ColorRules -> {},
ColorFunction -> "Rainbow"]
I don't want to manually provide ColorRules->{0 -> Red, 1 -> Orange, etc}
because when I change $k$ I don't want to change all the colors by hand.
RulePlot[CellularAutomaton[{5^3, 5, {1, 1}}]] /. {GrayLevel[g_], r_Rectangle} :> {ColorData["Rainbow"][g], r}
give what you need? $\endgroup$