HONG KONG—In a city split by months of antigovernment protests, consumers now have a way to identify which businesses appear to share their views, putting shops on alert and offering Hongkongers a way to show their colors.

The colors, in this case, are yellow or blue.

With apps and social-media groups, shoppers and diners can search color-coded...