Пример #1
0
        private Color ConvertColor(CT_Color1 c)
        {
            if (c == null)
                return null;

            Color res = new Color();
            if (c.indexedSpecified)
            {
                if (c.indexed < indexedColors.Count)
                    res = indexedColors[(int)c.indexed].Clone();

                res = XlioUtil.GetDefaultIndexedColor(c.indexed);
            }
            else if (c.themeSpecified)
            {
                res = XlioUtil.GetDefaultThemeColor(c.theme);
            }
            else if (c.rgb != null)
            {
                res = new Color(c.rgb);
            }

            if (res != null)
                res.tint = c.tint;

            return res;
        }
Пример #2
0
 private List<Color> ConvertColorList(CT_Color1[] ct_color1Arr)
 {
     var colors = new List<Color>();
     foreach (CT_Color1 ct_color1 in ct_color1Arr)
     {
         Color color = ConvertColor(ct_color1);
         colors.Add(color);
     }
     return colors;
 }