Vastly improved algorithm's speed.
Now, checks colors in order of magnitude, faster than a linear search.