How to implement colors from the database on the pie chart?

In my database I have stored colors as a string and I need to convert those colors to the hexadecimal and implement on the pie chart. Is there a good way to do this?
Here is my javascript code. There are two arrays (series and colors) in which I stored data.

   <script type="text/javascript">
    $(function () {
            url: 'getItems',
            dataType: "json",
            type: "GET",
            contentType: 'application/json; charset=utf-8',
            async: false,
            processData: false,
            cache: false,
            delay: 15,
            success: function (data) {

                var series = new Array();
                var colors = new Array();
                for (var i in data) {
                    var serie = new Array(data[i].name, data[i].y, data[i].color);


            error: function (xhr) {

    function DrawPieChart(series,colors) {
       Highcharts.chart('container', {

            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: 1, 
                plotShadow: false,

            title: {
                text: ' Vehicle Summary'
            tooltip: {
                pointFormat: '{}: <b>{point.percentage:.1f}%</b>'
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: false
                    showInLegend: true

            colors: [colors],
            series: [{

                type: 'pie',
                name: 'Task Status',
                data: series

Here is my method which takes the values of the items from the database procedure called “percentage”.

public ActionResult getItems()
        List<itemViewModel> result = new List<itemViewModel>();
        result = unitOfWork.ExecuteSP<itemViewModel>("[percentage]");

        var res = result.OfType<string>();

        foreach (var dr in res)
            itemViewModel summary = new itemViewModel();
   = dr[0].ToString().Trim();
            summary.y = Convert.ToDecimal(dr[1]);
            // color


        return Json(result, JsonRequestBehavior.AllowGet);

Also, this is my model

public class itemViewModel
    public string name { get; set; }
    public decimal? y { get; set; }
    public string color { get; set; }


you can do this by setting the expression of color property of piechart, by going to series property–>Fill—>click on fx and give the expression. even though i have given you this soln but i don’t think your approach is right

the approch that you are following is not the best of approach no need to store color in Database, just calculate it in color expression from other values