In fact, the model of dhimma as defined in the Quran and in the hadith (the sayings of the Prophet Muhammad) stipulated that while Christians and Jews must pay a supplemental tax in exchange for exemption from military service, they were not to be forcibly converted to Islam. (...) Some descriptive sources from the medieval period (from the seventh through the fifteenth centuries) show that these prescriptions were not always followed. For example, in many cities under Islamic rule, Christians and Jews were compelled to wear specific colors and/or types of clothing in order to physically distinguish themselves from Muslims."
This blog quotes from "Diversity in the Medieval Middle East - Inclusions, Exclusions, Supporters, and Discontents" by Rachel Goshgarian, Chapter 9 in Lucia Volk's The Middle East in the World: An Introduction (Foundations in Global Studies) (Routledge, 2015) on www.academia.edu;; illustration A Jew and a Muslim playing chess in 13th century al-Andalus. El Libro de los Juegos, commissioned by Alphonse X of Castile, 13th century. Madrid, Public Domain, source Wikimedia