"'Then in God's name take blue for red,' said Mahbub, alluding to the Hindu colour"
Red (Hindu) turban
Creative Commons AttributionRed (Hindu) turban - Credit: John Haslam, Flickr

A red turban is worn traditionally by Hindus, while a blue turban is associated with Islam. As Mahbub is a Muslim, if Kim is to work as his assistant he must appear to come from the same community, so as to avoid suspicion.  

Turban wearing in India is governed by a plethora of cultural codes. The style, size and colour of a given turban may denote the religion and caste of the wearer, as well as his status within society.