Creating materials for text/labels

I’m trying to extend the canvas text code example ( by creating and adding materials programmatically (

So far, I’ve added the following to Text.prototype.initialize:
var material = new pc.PhongMaterial(); this.entity.model.meshInstances[0].material = material;
which seems to add a material, but the text isn’t visible.

What am I missing?

Also how can I change the colour of the new material?