var canvas= new fabric.Canvas('c');
var newText = new fabric.IText("Elegant Living",{
left:50,
top:50,
fontWeight: 600,
fontSize:28,
styles: {
0: {
0: { fill: '#9ba9b4' },
1: { fill: '#9ba9b4' },
2: { fill: '#9ba9b4' },
3: { fill: '#9ba9b4' },
4: { fill: '#9ba9b4' },
5: { fill: '#9ba9b4' },
6: { fill: '#9ba9b4' },
8: { fill: '#b31706' },
9: { fill: '#b31706' },
10: { fill: '#b31706' },
11: { fill: '#b31706' },
12: { fill: '#b31706' },
13: { fill: '#b31706' },
},
},
name: "text"
});
canvas.add(newText)
canvas {
border:2px dotted blue;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.7.17/fabric.min.js"></script>
<canvas id='c' width=400 height=400></canvas>