Suppose I can define a color c as c = (cr , cg , cb), where cr , cg and cb are floats between 0 and 1 (inclusively).
Suppose I have an input color c and a matrix M of dimensions m×n, whose elements M[i][j] are colors.
How can I organize the elements of M so that I can develop an algorithm that finds the color inside M that is the most similar to c?
Similarity can be measured by euclidian distance or any other metrics.
Ideally, I would not use any data structures in the algorithm, because this is something that is going to run in the GPU and it doesn't use data structures.