I think what you want should be possible. It will require a bit of hard coding to pre-define the different colors. Using values defined during a loop as a class to the newly generated span you can use modulus to apply a desired colored class. I have no information on how your text relates to a value that determines the desired color so this is the best I could come up with:
var colors = ['red','blue','green','orange'];
var text = document.querySelector('.text').innerHTML;
var length = text.length;
for ( i = 0; i < length; i++ ) {
var span = document.createElement('span');
span.className = 'coloredText '+(i + 1);
span.innerHTML = text[i];
document.body.appendChild(span);
}
var list = Array.prototype.slice.call(document.querySelectorAll('.coloredText'));
var listLength = list.length;
for ( j = 0; j < listLength; j++ ) {
var number = list[j].className.split(" ")[1] % 4;
console.log(number);
console.log(colors[number]);
list[j].className = list[j].className += ' ' + colors[number];
}
Working example of dynamically generating spans with different colors simply from a string of text: http://jsfiddle.net/Kxgbb/