added more robust color matching