There was a social custom that non-Muslims would avoid wearing green, and a legal precedent which was rarely enforced:
Green was the colour of Islam, which adorned the turbans of the descendants of the prophet Mohammad (eşraf), who for this reason are often referred to in the English sources as “Greenheads”. Non-Muslims were not allowed to wear green, because it was considered an insult to Islam. The Ottoman authorities generally do not seem to have enforced this rule. Foreigners in Istanbul and Izmir never had any problems of this kind, the husband [of a Dutch woman dragged into court on account of green slippers in 1693] pointed out in vain.
(Bold added.) The academic documenting this case offers an explanation for why the law was invoked in the case of this Dutch woman:
... the existence of a large community of eşraf had a traceable effect on the legal position of foreigners. The prominence of this group increased what we might call the Islamic sensibilities of the Muslim population. This meant that Europeans had to be careful not to give offence. An arrogant glance, or the public display of green clothing could easily lead to (threats of) litigation, something that was probably facilitated by the fact that the descendants of the Prophet Muhammad were a well-organised and politically powerful faction in Aleppo.
Maurits H. Van den Boogert, The capitulations and the Ottoman legal system : Qadis, Consuls and Beratlıs in the 18th Century (Brill, 2005).
The eşraf were a highly privileged class in Ottoman society, and likely flaunted their green dress. Foreigners, who enjoyed extraterritoriality thanks to agreements between the Ottoman elites and the European governments, surely threatened the uniqueness of these legal privileges whenever they appeared in public.
Seyyids in the Ottoman Empire, like in most of the other Islamic societies, were identified from ordinary people by a green sign (alâmet), especially a green sarık, and enjoyed certain privileges like being exempt from taxation and their legal cases being heard before the nakîbü 'l-eşraf or his representatives. However, it seems that the institution was open to personal influences and bribery.
Gonca Baskıcı, "A life between piety and politics: Azîz Mahmŭd Hüdâyî (ca 1543-1628)" (master's thesis, Bilkent University, 2000), citing İsmail Hakkı Uzunçarşılı, Osmanlı Devletinin İbniye Teşkilatı (Ankara: Türk Tarih Kurumu Basımevi, 1965), pp. 163-172.
For those interested, Mouradgea d'Ohsson's Tableau général de l'Empire othoman (1788) apparently provides more details on the snobbish customs of the eşraf:
Male or female, all made themselves visible by the green color of their headgear, with certain exceptions. For example, those who served the ruler would wear white turbans in deference to a ruler whose house could not claim prophetic descent...
Carter Vaughn Findley, Enlightening Europe on Islam and the Ottomans: Mouradgea d'Ohsson and His Masterpiece (Brill, 2019)