This is a rough sketch, but functional:
You could implement some dynamic stuff so that the user could select the options to generate the code.
You could still have all the color combos present as like clickable buttons for presets that would auto-set the code to match them.