Well, it all depends what you want to test. Normally, such an experiment should try to detect which colours when compared can still be distinguished, detecting the smallest notable difference/patterns which don't work for subgroups. I don't see how that could work well with the measurement.
If it really is about the whole row of colours, then the levenshtein distance could indeed work well.
It seems this would not fix the issue of having one block off and thereby pushing a bunch of other blocks one off from their right position. You'd still have to move all those blocks back, which means the Levenshtein distance would not be short.
http://en.wikipedia.org/wiki/Levenshtein_distance