Name your block like "blue|block-title"
Then use a .blue class in the css.
In the template you need to work with smarty to check if the title has a | in it and then use first Part as css class and second as the title
class="block-<{block.id} >"
.block-4{background: #c3c3c3}