Create a shader program that generates a gradient image using an array of 5 colors. The colors are defined in the following array:
The program should determine which color range the current pixel falls within and interpolate its color accordingly. This will result in a smooth gradient transition between the colors in the array.