I am not sure where you want to put it, so here I have it in a div:
<div style="background-color: @Html.Raw(item.ColorHex); width:20px; height:20px;">
@Html.Raw(item.ColorHex)
</div>
UPDATE
So this line?
@Html.DisplayFor(modelItem => item.ColorHex)
@Html.DisplayFor
only emits text. The answer is the same, you need to wrap a div or span around the text. Or you can set the color on the Table cell itself.
Here it is wrapped around your element:
<td style="background-color: @Html.Raw(item.ColorHex);">
@Html.DisplayFor(modelItem => item.ColorHex)
</td>