get closest color function