On form (APEX 5.0.4) I have many buttons for which I have to set different colors for each button when page open regarding to different criteria (using from input or SQL). For example below user can type some values in Criteria 1 and 2 and when he clicks Set buttons buttons from 100 - 600 color appropriately.

Above colors I set in design mode (to show what I want to do in runtime) over Appearance > Template Options > Type, but I don't know how to set this colors at runtime or even better how to set arbitrary colors now just 4 predefined colors.
I was looking for some existing example for such task but I can't find it. I would really apreciate if someone can help me with some concrete tips or solution for this task.
BB