Regarding the multiple letters macro "\FormatChars" posted in Emphasizing Arabic text characters. Is there a way to modify this macro such that:
You can select any set of characters you want to modify despite of their arrangement within the word, I have noticed that you can only select a consecutive set of letters (so you select letters from 1 till 3, 2 till 4...) yet there is a need to select non-consecutive characters within the same word (the first and third letters for example, or second and fifth letter...etc)
Set the formatting to be applied for each of the selected characters seperately so that a different type of formatting can be applied to each of the selected characters instead of applying the same formatting to all of the specified characters.

َand tanweenٌinside\textcolor{blue}{}and\textcolor{red}{}commands. – Salim Bou Aug 19 '20 at 19:50luacolorpackage without it you lose font shaping in case of using\textcolor(lualatex engine). – Salim Bou Aug 19 '20 at 19:56