I have an image of polygons built from a polar function (see below). I'd like to color each triangle or quadrilateral a random color.
Firstly, I'm not sure how to separate the simple shapes.
Secondly, I can't think of a simple way to color each a random color (only 3 different colors result with Colorize
).
sunflower = 2 Pi (1 - 1/GoldenRatio);
PolarCoordinate[r_, theta_] := r {Cos[theta], Sin[theta]}
Graphics[Polygon[
Table[PolarCoordinate[i^10, i*sunflower], {i, 1, 1000}]],
AspectRatio -> 1] // Colorize
p = Graphics[ Polygon[Table[PolarCoordinate[i^10, i*sunflower], {i, 1, 500}]], ImageSize -> 1000]; MorphologicalComponents[ColorNegate@Dilation[p, 2], CornerNeighbors -> False] // Colorize
$\endgroup$