Imagine the picture below is a piece of yarn:
![Color gradient test.jpg]()
Is there a way in photoshop to "stretch" this yarn into a straight line. In other words, is there a way to copy the color gradient and apply it to a straight line with all of the relative distances between colors preserved?