making a simple algorithm to find matching colors