ok i' try it but nothing...
i think that TsSpreadBIFF8Writer.WritePalette is ok and the five first colors are
{ Now the colors, first the standard 16 from Excel }
AStream.WriteDWord(DWordToLE($000000)); // $08 --> Field rgColor[0] of Palette
AStream.WriteDWord(DWordToLE($FFFFFF)); //--> Field rgColor[1] of Palette
AStream.WriteDWord(DWordToLE($FF0000));//--> Field rgColor[2] of Palette
AStream.WriteDWord(DWordToLE($00FF00));//--> Field rgColor[3] of Palette
AStream.WriteDWord(DWordToLE($0000FF));//--> Field rgColor[4] of Palette
then i read
http://msdn.microsoft.com/en-us/library/dd907610%28v=office.12%29.aspxhttp://msdn.microsoft.com/en-us/library/dd773056%28v=office.12%29.aspxand i understand that this constants are ok too
{ Built In Color Pallete Indexes }
BUILT_IN_COLOR_PALLETE_BLACK = $08;
// 000000H --> Field rgColor[0] of Palette is ok
BUILT_IN_COLOR_PALLETE_WHITE = $09;
// FFFFFFH --> Field rgColor[1] of Palette is ok
BUILT_IN_COLOR_PALLETE_RED = $0A;
// FF0000 -->Field rgColor[2] of Palette expeted but paint 0000FF field rgColor[4] of Palette
BUILT_IN_COLOR_PALLETE_GREEN = $0B;
// 00FF00H --> Field rgColor[3] of Palette is ok
BUILT_IN_COLOR_PALLETE_BLUE = $0C;
// 0000FF -->Field rgColor[4] of Palette expeted but paint 0000FF field rgColor[2] of Palette
but i dont understand why works ok for some fields of the palette and change anothers. maybe later....
OK.. i edit this post, i find this url
http://dmcritchie.mvps.org/excel/colors.htmwhen i read this:
str0 = Right("000000" & Hex(Cells(i + 1, 1).Interior.color), 6)
'Excel shows nibbles in reverse order so make it as RGB
str = Right(str0, 2) & Mid(str0, 3, 2) & Left(str0, 2)
And my tests confirm this excel paint hexadecimal colors changing pos 1 and 2 for pos 5 and 6...
if in
TsSpreadBIFF8Writer.WritePalette we add the color $FF0000 in the pos 2
when excel paint a cell with the pos 2 color of the palette he paints $0000FF
same with any hexadecimal color, for example with the Built In Color Palette Indexes:
we write excel paint
008080H --> 808000H
808000H --> 008080H
000080H --> 800000H
800000H --> 000080H
00FFFFH --> FFFF00H
FFFF00H --> 00FFFFH
Now i'm not sure for the best mode of solve this rewriting TsSpreadBIFF8Writer.WritePalette or maybe with a function that reverse the orders of nibbles if we want use standard html colors in the source.
I'm thinking change de source for me Making a class Personal palette with a 2 dimensions array with te color name and the hexadecimal value of the colors for personalize the Palette with my personal colors. Writing of course a method writeInXlsPallete that reverse de hexadecimal colors introduced in the addColor(ColorName,HexadecimalValue) ¿Bad idea?