The point of the code was to add the colour so modifying it to find colour is "putting the cart before the horse" - ie the colour isn't there to find yet.
Your description of what you actually wanted to do sounds like it is completely unrelated to the code that has been discussed to date
Quote:
For typing purposes the words are separated by a space, but when looking to publish, the words will be joined up into one line.
Now to read in this form, it takes a great deal of learning etc. I've come up with an idea where by I use alternate colours with the words, so when joined up, you can still make out the word due to it being a different colour.
Here is were I have an issue... the colour coding script doesn't like consecutive repeat words i.e. the the or is is as an example.
It flips the colour pattern, so where it would be: red, black, red, black, red, black
when it comes to these repeat words, it will go: red, black, black, red, red, black
with that said, if we when join up the words, 2 black words will join implying that it 1 word and 2 red words will join again implying 1 word, which would then be incorrect.
|
This sounds like you want to convert content like this
The rain in spain falls mainly on the plain
into
Therain
inspain
fallsmainly
onthe
plain
Is that what you are trying to achieve?