$('#typeProject').click(function(){
var colors = ['green', 'red', 'blue', 'yellow'];
var key = Math.round(Math.random()*(colors.length-1))
$('.typeProject').css('background-color', colors[key]);
console.log(key);
});
function* cyclicSequence(items) {
for (var i = 0; ; i = (i + 1) % items.length) {
yield items[i];
}
}
var color = cyclicSequence([ 'green', 'red', 'blue', 'yellow' ]);
$('#typeProject').click(function() {
$('.typeProject').css('background-color', color.next().value);
});
$('#typeProject').click(function(){
if(!$(".typeProject").attr("data-numcolor"))
$(".typeProject").attr("data-numcolor",0);
var colors = ['green', 'red', 'blue', 'yellow'];
var num = $(".typeProject").attr("data-numcolor");
$('.typeProject').css('background-color', colors[num++]);
num %= colors.length;
$(".typeProject").attr("data-numcolor",num);
});