1

我想从 RTF 文件中读取表格内容以及表格单元格颜色信息。在我的 RTF 文件中,颜色表定义为

{\colortbl;
\red0\green0\blue0;
\red0\green0\blue255;
\red0\green255\blue255;
\red0\green255\blue0;
\red255\green0\blue255;
\red255\green0\blue0;
\red255\green255\blue0;
\red255\green255\blue255;
\red0\green0\blue128;
\red0\green128\blue0;
\red128\green0\blue128;
\red128\green0\blue0;
\red128\green128\blue0;
\red128\green128\blue128;
\red192\green192\blue192;
}

我有表格标题行的 RTF,

\trowd \trql\trgaph90\trleft-90\trautofit1
\clvertalt
\clbrdrl\brdrs\brdrw15\brdrcf1
\clbrdrt\brdrs\brdrw15\brdrcf1
\clbrdrr\brdrs\brdrw15\brdrcf1
\clbrdrb\brdrs\brdrw15\brdrcf1
\clcfpat7\clcbpat8\clshdng2000
\cellx1440
\clvertalt
\clbrdrl\brdrs\brdrw15\brdrcf1
\clbrdrt\brdrs\brdrw15\brdrcf1
\clbrdrr\brdrs\brdrw15\brdrcf1
\clbrdrb\brdrs\brdrw15\brdrcf1
\clcfpat7\clcbpat8\clshdng2000
\cellx2970
\pard
\intbl \widctlpar\keep\hyphpar0
\li0\ri0\fi0
\ql{Product Name\cell
}{Price\cell}\row

表格单元格背景信息以“\clcfpat7\clcbpat8\clshdng2000”的形式给出。

请帮我从颜色信息中找到表格单元格的正确颜色。

4

1 回答 1

2

颜色按索引顺序排列

{\colortbl;
  1 =  \red0\green0\blue0;
  2 =  \red0\green0\blue255;
  3 =  \red0\green255\blue255;
  4 =  \red0\green255\blue0;
  5 =  \red255\green0\blue255;
  6 =  \red255\green0\blue0;
  7 =  \red255\green255\blue0;
  8 =  \red255\green255\blue255;
  9 =  \red0\green0\blue128;
  10 = \red0\green128\blue0;
  11 = \red128\green0\blue128;
  12 = \red128\green0\blue0;
  13 = \red128\green128\blue0;
  14 = \red128\green128\blue128;
  15 = \red192\green192\blue192;
}

这个控件\clcbpat8是说,用颜色编号 8 绘制单元格的背景,在列表中它是白色的。将其更改为 9,您将获得更深的蓝色。

于 2012-11-07T12:28:16.400 回答