More than 32 colours for gradients in Cycles?
These are some node groups to accomplish colorRamps mixing based on the UV coordinates and certain scale ( in this example it's 8 ), which give as a total of 256 color,  this is the final setup :

and these are the node groups needed :
&quot;Equal to&quot; node group : compare two numbers and output one if they are equal else a Zero

&quot;Mapper&quot; node group : remap the input ( by scaling) and output an integer number ( 0, 1, 2...) for controlling the color switches

&quot;ColorRamps&quot; node group : a group of colorRamps sharing the same factor input

&quot;Decoder&quot; node group: switch only one of the outputs to one if the input is equal to it's order

&quot;ColorMix&quot; node group: switch between colors based on the input if input = 5 the output will be the color-5

this will allow you to combine multiple color ramps as follow :
for this example ( scale = 8 ): colorRamp zero will be used for U coordinates from 0.0 to 0.125 ,and colorRamp one from 0.125 to 0.250 and so on. You can try any scale equal to or less than 8 .
Note : since color ramps are separate there will be no transition between them but you can fake this by repeating the last color of the previous node as the first color of the next one.
test render :