I have a X and Y plane with values 0,0 - 160,160. Each point has a value that ranges from 0 to a peak value. I'm trying to display the points in a grid with the point's value represented by colors, like a heat map. How do I create a color space on the iphone that has good contrast and I can move across the color space using the point's value? I have created the grid of points using the following code, i've been experimenting with math to create an RGB color for each point with little success.
What's the easiest way to create a color space with high contrast? I've googled around but couldn't find anything for iphone, only color programming on the mac. Please point me in the right direction and I can start figuring it out.
Thanks.
Code:
for (int x = 0; x < (gridsize * res); x ++) {
for (int y = 0; y < (gridsize * res); y ++) {
fx = (float) x / (float) res;
fy = (float) y / (float) res;
subrect = rectsize/res;
points[x][y] = #math to create value
CGContextSetRGBFillColor(c, (points[x][y]/coords[3]), 0.0, 0.0, 1.0f);
CGContextFillRect(c, CGRectMake((x*subrect+160), (y*subrect+160), subrect, subrect));
CGContextFillRect(c, CGRectMake((x*-subrect+160), (y*-subrect+160), subrect, subrect));
CGContextFillRect(c, CGRectMake((x*-subrect+160), (y*subrect+160), subrect, subrect));
CGContextFillRect(c, CGRectMake((x*subrect+160), (y*-subrect+160), subrect, subrect));
}
}
What's the easiest way to create a color space with high contrast? I've googled around but couldn't find anything for iphone, only color programming on the mac. Please point me in the right direction and I can start figuring it out.
Thanks.