I've used a Table[]
to generate multiple rounded squares, with Rectangle[{m, n}, RoundingRadius -> .35]
. So far, I've been able to color all the squares with the same color, for instance, with LightBlue
:
Graphics[{EdgeForm[Black],
Table[{LightBlue, Rectangle[{m, n}, RoundingRadius -> .35]}, {m,
5}, {n, 5}]}, Frame -> True]
Or generate random colors for each square, for instance, with Hue[RandomReal[]]
:
Graphics[{EdgeForm[Black],
Table[{Hue[RandomReal[]],
Rectangle[{m, n}, RoundingRadius -> .35]}, {m, 5}, {n, 5}]},
Frame -> True]
But, generally, I'd like to control the color of each of the squares independently, because I already have a vector of Hue[#]
colors that I want to use. For instance, I'd like to use this 25 colors in correspondence to each of the (m,n)
squares in the grid:
m=5;
n=5;
Split@Hue[#] & /@ Range[1/(m*n), 1, 1/(m*n)]
I've tried to do something like the following, but it doesn't seem right:
Graphics[{EdgeForm[Black],
Table[{c, Rectangle[{m, n}, RoundingRadius -> .35]}, {m, 5}, {n,
5}, {c, Split@Hue[#] & /@ Range[1/(m*n), 1, 1/(m*n)]}]}, Frame -> True]
I've also tried to Map[]
the colors or use a ColorFunction->
but had no success.
I'd appreciate any help, thanks! -Pedro