Accidentally had MAX and MIN swapped. All should be good now.
No longer using euclideanDistanceFromColor:
Trying to use doubles instead of CGFloat, maybe?