More robust color check