A point P is chosen at random on the (x, y) plane and all points on the square grid are sorted by euclidean distance from P. Then a color C is chosen at random on the (r, g, b) space and all colors on the cubic grid are sorted by euclidean distance from C. Finally, points and colors are matched based on their indexes.