I have the following code:
var set = paper.set();
var text = paper.text(0, 0, 'bla1 bla2' ).attr({ fill: 'blue'});
set.push(text);
How can I change the color of the 'bla2' to green now?
I've already tried to split the string into two text-elements and assign the coordinates of the 'bla1'+ width of the 'bla1' to the second one. It didn't work since I coundn't find out the width of 'bla1'. The second problem with this solution is that I might want to change the font-size of 'bla1 bla2' which will automatically change the width of 'bla1' and distort the position of 'bla2'.
Thanks in advance!
You can try something like this:
HTML:
JS:
Demo: http://jsfiddle.net/aamir/zsS7L/