Highlight and color text

I’m trying to work out how to create a simple colour picker, with say 9 colours, and then use it (from the drop down menu) to highlight selected sections of text.

Can anyone give me some direction on how to do this?

Thanks in advance.

What did you try so far?