感谢 AndASM 对这个特定问题的精彩描述。我一直在编写一个使用该Win32::OLE
库读取 word 文档的 Perl 程序。我的目标是以不同的格式输出文档,当我遇到这些索引值时,我发现自己深受困扰。在被引导到正确的方向之后,我最终在 Perl 中为这些索引构建了一个哈希查找。我去掉了所有其他看起来无用的十六进制字符串(比如&H00
字节),并构造了一个搜索字符串,当通过这个哈希映射输入时返回 RGB 值:
my %indexedColors = (
"ff0000" => [0,0,0],
"dcffff" => [255,255,255],
"dcf2ff" => [242,242,242],
"dcd9ff" => [217,217,217],
"dcbfff" => [191,191,191],
"dca6ff" => [166,166,166],
"dc80ff" => [128,128,128],
"ddffff" => [0,0,0],
"ddff80" => [127,127,127],
"ddffa6" => [89,89,89],
"ddffbf" => [64,64,64],
"ddffd9" => [38,38,38],
"ddfff2" => [13,13,13],
"deffff" => [238,236,225],
"dee6ff" => [221,217,195],
"debfff" => [196,188,150],
"de80ff" => [148,138,84],
"de40ff" => [74,68,42],
"de1aff" => [29,27,17],
"dfffff" => [31,73,125],
"dfff33" => [198,217,241],
"dfff66" => [141,179,226],
"dfff99" => [84,141,212],
"dfbfff" => [23,54,93],
"df80ff" => [15,36,62],
"d4ffff" => [79,129,189],
"d4ff33" => [219,229,241],
"d4ff66" => [184,204,228],
"d4ff99" => [149,179,215],
"d4bfff" => [54,95,145],
"d480ff" => [36,64,97],
"d5ffff" => [192,80,77],
"d5ff33" => [242,219,219],
"d5ff66" => [229,184,183],
"d5ff99" => [217,149,148],
"d5bfff" => [148,54,52],
"d580ff" => [99,36,35],
"d6ffff" => [155,187,89],
"d6ff33" => [221,217,195],
"d6ff66" => [214,227,188],
"d6ff99" => [194,214,155],
"d6bfff" => [118,146,60],
"d680ff" => [79,98,40],
"d7ffff" => [128,100,162],
"d7ff33" => [229,223,236],
"d7ff66" => [204,192,217],
"d7ff99" => [178,161,199],
"d7bfff" => [95,73,122],
"d780ff" => [64,49,82],
"d8ffff" => [75,172,198],
"d8ff33" => [218,238,243],
"d8ff66" => [182,221,232],
"d8ff99" => [146,205,220],
"d8bfff" => [49,132,155],
"d880ff" => [33,88,104],
"d9ffff" => [247,150,70],
"d9ff33" => [253,233,217],
"d9ff66" => [251,212,180],
"d9ff99" => [250,191,143],
"d9bfff" => [227,108,10],
"d980ff" => [152,72,6],
);
希望没有可怜的灵魂必须深入研究微软的向后兼容性,但以防万一。