What exactly is the purpose of this:
// How far apart are the 'color' and 'c'?
dist = pow(red - r, 2) + pow(green - g, 2) + pow(blue - b, 2);
I don’t understand what is going on there at all. I see that we check next to see if it’s the closest distance, but closest distance to what?