Text preloader

how to make text acting as a preloader so that its color changes as preloader percentage.
i dont mean how to apply the math, i mean how to mask it or whatever action to achieve that effect?[COLOR=Red]

[/COLOR]like for example imagine the red is constantly growing to the right letter by letter (actually pixel by pixel:[COLOR=Red]

SOME T[/COLOR]EXT