I have a float array of approximate dimensions 3000x1. This array contains values ranging from between -10^(-3) to 10^(-3). I want to use these values to colour an image on the display of an Android phone using the setColor method, which accepts an RGB value as an int.
I want the minimum values, e.g. -10^-3 to appear blue, and as you approach 0 to become more green. From 0 onto the maximum values the colour should go from green to a yellow/orange/red colour. I am fairly confident that this is an easy problem to solve.
Essentially, min(my_array) should get assigned with an approximate 0x0000F0. As we go from min(my_array) towards 0, the colour should gradually become more turquoise, until it reaches green. From there on it should head towards yellow and red, until reaching max(my_array).
Would I need to divide the RGB map into say 3000 segments. Then I could order my array into ascending order, and add as a 2nd column the corresponding RGB values, in the ascending order. I am then unsure about how to get the array back into the original order however.