Hi All
trying to figure something out wondering if anyone had any pointers/ideas on best way to achieve the following?
I have some temperature data for dynamic period, as in can be any number of days, that i'd like to assign colours to based on relationship to min and max temperature.
I have stored all the temperatures into a sorted array so i know what the min and max are and can assign RED (255/0/0) to last array element and BLUE (0/0/255)to the first array element.
What i need to do is assign HEX colour values to the remaining temps so the middle is WHITE.
So as an example:
DailyTemps: (9.5,9.6,10,11.2,12.4,14.5,19.2)
9.5 = 0,0,255
9.6
10
11.2 = 255,255,255
12.4
14.5
19.2 = 255,0,0
I want to programmatically assign values to ones in between blue->white and then white->red
This is a very simplified example as there could be a couple of hundred temperatures in the array but i'm assuming the process would be the same no matter the size of the dataset
i hope this makes sense, i know its a bit of a weird question and not something majorly urgent as its more a nice to have for something but just trying to figure it out and can't and would like to understand if its possible (i mean its easy to do in excel i know to assign a colour map to a dataset so i'm just trying to achieve something similar)
thanks in advance
Glen
trying to figure something out wondering if anyone had any pointers/ideas on best way to achieve the following?
I have some temperature data for dynamic period, as in can be any number of days, that i'd like to assign colours to based on relationship to min and max temperature.
I have stored all the temperatures into a sorted array so i know what the min and max are and can assign RED (255/0/0) to last array element and BLUE (0/0/255)to the first array element.
What i need to do is assign HEX colour values to the remaining temps so the middle is WHITE.
So as an example:
DailyTemps: (9.5,9.6,10,11.2,12.4,14.5,19.2)
9.5 = 0,0,255
9.6
10
11.2 = 255,255,255
12.4
14.5
19.2 = 255,0,0
I want to programmatically assign values to ones in between blue->white and then white->red
This is a very simplified example as there could be a couple of hundred temperatures in the array but i'm assuming the process would be the same no matter the size of the dataset
i hope this makes sense, i know its a bit of a weird question and not something majorly urgent as its more a nice to have for something but just trying to figure it out and can't and would like to understand if its possible (i mean its easy to do in excel i know to assign a colour map to a dataset so i'm just trying to achieve something similar)
thanks in advance
Glen