The dog may not be willing to have people come up and try to pet him/her. The dog needs its space, just like some people do.
The yellow could also mean that the dog doesn’t like children or that the dog is very anxious or gets easily excited.
It is important to ask the dog’s owner before you approach. Just because a dog is out and about doesn’t mean they want to be approached by every person on the street.