@bluepenguindeveloper, your solution is very interesting!
One small filter improvement in <<getColor>> is to omit the !is[blank] operator, since the preceding getindex<c> operator implicitly rejects blank index values. You could also define a “getColour” function to handle the British spelling.
\function getColor(c) [{$:/palette}getindex<c>] ~[[$:/palettes/Vanilla]getindex<c>] ~[[$:/config/DefaultColourMappings/]addsuffix<c>get[text]] :map[function[recolor],<currentTiddler>]
\function getColour(c) [function[getColor],<c>]
Another potential improvement would be to define recolor(c) like this:
\function recolor(c) [<c>regexp<colorRegexp>] :then[<c>split[ ]last[]trim[']trim["]trim[>>]] :map[function[getColor],<currentTiddler>] :else[<c>]
which eliminates the need for the removeRegex() definition by using <c>split[ ]last[]trim[']trim["]trim[>>] to isolate the argument value when handling recursive <<colour>> references.
Lastly, the colorRegexp() definition should probably be extended to permit recursive <<getColor>> references, like this:
\define colorRegexp() <<(get)?[cC]olou?r .*>>
See [BUG] · Issue #8326 · Jermolene/TiddlyWiki5 · GitHub for a related discussion regarding a backward-compatibility issue with the <<colour>> macro in v5.3.4
-e