I am using this progress bar :
http://twitter.github.com/bootstrap/components.html#progress
And would like to give it a custom color, known only at runtime (
You should change the container div class in order to change the color.
Example using .progress-danger for red color:
More colors (just substitute button for progress in the class name). http://twitter.github.com/bootstrap/base-css.html#buttons
Update: In order to add the class name at runtime with javascript take a look at http://snipplr.com/view/2181/ or http://api.jquery.com/addClass/ if you are using jQuery.
Hope it helps.