0
As Hudsonph said the best would be to use css as a solution, but if you need to manipulate an array you already know with jquery, try the following:
var cores = ['red', 'yellow', 'gray', 'orange', 'blue', 'red', 'yellow']
AddColors(cores);
function AddColors(cores){
jQuery.each( cores, function( i, val ) {
$(".container").append("<div id='"+i+"'>Bla bla bla</div>");
$( "#" + i ).css("color", val);
});
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
</div>
Voce does not need jquery for this, only css solves your problem.
– HudsonPH