internal string GenerateColorTable()
{
int colorIndex = 1;
StringBuilder colorTable = new StringBuilder();
colorTable.Append(@"{\colortbl;");
foreach (ColorData colorData in AnsiColor.AnsiColors)
{
if (colorData.Type == ColorTypes.ForeGround || colorData.Type == ColorTypes.BackGround)
{
Color color = colorData.Color;
if (color != null)
{
colorTable.AppendFormat(@"\red{0}\green{1}\blue{2};", color.R, color.G, color.B);
colorData.ColorTableIndex = colorIndex;
colorIndex++;
}
else
{
colorData.ColorTableIndex = 0;
}
}
}
colorTable.Append(@"}");
return colorTable.ToString();
}