I'd like the colors to remain in same position while the helix spring is rotating.
As @Allen Simpson has commented:
If you use a single cyclic Bezier curve, given thickness with its native Bevel, (set in its Data tab > Geometry panel,) it is automatically mapped 0->1 in U along its length.
So a node arrangement like this can set the color-ramp's range of colors along its length:
The Add and Wrap nodes are optional: changing the 'Add' value shifts the whole range along the curve.
if your spiral is in the origin you can use this node setup:
Play with the threshold to get your desired result.
and you get this: (seen from above)
what the setup does is: it calculates the length (xx + yy) and checks whether it is inside a given range (threshold) and if it is, it takes the first colorramp, else the second.
sorry for my bad modelling. Modelling is not my strength :(
if you don't get this to work, please provide your blend file, then i can adapt it especially to your needs.