A small widget could easily do this. I might have time later this week. Is the textbox supposed to have any content or does it just need a size + background-color attribute ?
Edit: It's nearly done, I'll upload it to the AppStore tomorrow and you can let me know if it needs to do anything else.
Edit2: The widget is now available at Color Textbox.
Depending on the number of colorcodes you actualy use, create an Enum with the values of the colorcode atribute and an image in the correct color
I guess you need a custom widget for that.