Dynamic Hex Numbers using Magic Text

I need the hex number to be dynamic using magic text. This would make it possible for the active color on a tab bar to match an input from the database, or the color of a button to match an input from the database, etc.