using Microsoft.Office.Interop.Word;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OfficeAppHelp.Word
{
    /// <summary>
    /// 颜色扩展
    /// </summary>
    public static class ColorEx
    {
        /// <summary>
        /// 转为Word颜色
        /// </summary>
        /// <param name="c">颜色</param>
        /// <returns>WdColor类型的颜色</returns>
        public static WdColor ToWordColor(this Color c)
        {
            return (WdColor)(c.R + 0x100 * c.G + 0x10000 * c.B);
        }
    }
}
