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);
        }
Exemple #2
0
        private CT_Color1 ConvertColor(Color color)
        {
            if (color == null)
            {
                return(null);
            }
            CT_Color1 res = new CT_Color1();

            res.rgb = new[] { color.a, color.r, color.g, color.b };
            return(res);
        }