Reading Files. Font color

Is it possible to detect the font color in a cell? (By reading existing File)
Or the background color in the cell? Bold or italic font?
Demo ReadingFiles/"Value in Current Cell" 
In html:  return only the value. All the time
By Format values or not.
Thank you, Miro
Hi,
There are 2 things here:
1. The font of the cell itself.
2. The fonts inside the text.

You might have a cell which is bold, and text inside, and this looks the same as a normal cell, but with all text inside in bold. Or to put it other way [Cell bold]Text[/CellBold] looks the same as [Normal cell]<b>Text</b>[/Normal Cell]

To get the fist type you would select the cell and press bold in Excel, and to get the second you would select all the text inside a cell and mark it bold.

So you need to check for both things, and in fact you might have some text with some parts in bold and some parts without bold.

But well, to get the font of a cell, you get it with:
fmt := xls.GetCellVisibleFormatDef(Row, Col);
DoSomething(fmt.Font)

In Fmt.Font you can access if the cell is bold or italic, etc. But remember that this is the font of the cell. You might have a bold cell, and the text inside marked as "no bold" and the text would look normal even if fmt.Font report bold.

Please, how to exact read color from the file generated via GettingStarted?

Red font color in a A1 cell? 

As said, just use Xls.GetCellVisibleFormatDef and read the fmt.Font.Color property.


You could change the procedure "ActionValueInCurrentCellExecute" in the reading ReadingFiles demo to be:
procedure TFReadingFiles.ActionValueInCurrentCellExecute(Sender: TObject);
var
  fmt: TFlxFormat;
begin
  AnalizeFile(SheetData.Row, SheetData.Col);
  fmt := Xls.GetCellVisibleFormatDef(1, 1);
  ShowMessage('Font color in A1 is #' + IntToHex(fmt.Font.Color.ToColor(xls).ToArgb and $FFFFFF));
  ShowMessage('Cell color in A1 is #' + IntToHex(fmt.FillPattern.FgColor.ToColor(xls).ToArgb and $FFFFFF));
end;

And it will show you the background color and font color of the cell. As said in my previous post, be careful that you might have say a black font color, but have the text inside to be <font color="Red">text</font>. The color might be set either at cell level or at the text level.