Randomized color with array modifier
Cycles
You can use parameter Random per Island
&quot;A random value for each connected component (island) of the mesh. It is useful to add variations to meshes composed of separated units like tree leaves, wood planks, or curves of multiple splines.&quot;


BTW For &quot;rainbow&quot; ColorRamp you can set just a two colors (Red-Blue) with HSL &gt; Clockwise.
Or for your full ring - Red-Cyan-Red. https://imgur.com/XUFqIju