Help making current word in Text change to a color as you type

What I mean by “current word” is this:


The current word I have highlighted or just the word that I have my cursor on.
Basically I would like to have the current word selected to change to a color like red or blue, then when the word is not selected it will not be colored anymore. I do not have any idea how to do this, i think this might have something to do with TextButton.RichText?

i think you should change the Category from Art Design Support to scripting support because i think the only way to do this is with a script.