I am working on a simple program to just draw circles around some fixed points using the Python turtle package; however, I wanted to make it somewhat like a heat map where the colors get "cooler" as they get farther from the original point. My idea was to take the base white color, #FFFFFF, and subtract a percentage based from that on the distance away.
I assumed hex color codes worked by getting lower in its hex value as the color gets "cooler", but I have now read that the first two mean its red value, the second its green, and the last its blue. How would I go around implementing a heat map the way I want it to work?
I'm confident the distances are correct, I just think I'm using the color codes in the wrong way. The function I wrote to do the color calculation:
def findColor(dist):
base = "FFFFFF"
num = int(base, 16)
percent = dist/800 #800 is the max distance away
newNum = (num - (num*percent))
color = hex(int(newNum))
return color
The resulting map I get is:
With Ignacio Vazquez-Abrams' help about HSV, I've got it looking like this :) :