I suspect this isn't so much a ui-grid thing, as being a general question of how you render data with in angular colours.
I would probably do this with a custom cellTemplate, and some sort of ng-style. The question is how your data is arriving in the cell - so are the 1 3 4 coming from the cell value, or do you have something else going on?
Assuming that they are in the cell value, then you'd probably need something like
<div ng-style="grid.appScope.setStyle(grid.appScope.left(COL_FIELD)>grid.appScope.left(COL_FIELD)</div>
<div ng-style="grid.appScope.setStyle(grid.appScope.mid(COL_FIELD)>grid.appScope.mid(COL_FIELD)</div>
<div ng-style="grid.appScope.setStyle(grid.appScope.right(COL_FIELD)>grid.appScope.right(COL_FIELD)</div>
Where
- setStyle is a function on your scope that takes in a number and decides what style to apply to it
- left gets the leftmost number from your data
- mid gets the middle number from your data
- right gets the rightmost number from your data
If your input structures are different then there are other ways to use cellTemplates to get the result you want.
EDIT: Based on the further information, I think you'll want to render your string as html, and then parse that html into the cell. I think this is then more a broader question of "how can angularJS render arbitrary HTML for me", and the answer may be ng-bind-html, although I don't know much about it. In theory that would let you create your markup in html, then bind that resulting markup into the cell by using ng-bind-html='COL_FIELD' in the cellTemplate.