HotXLS-dokumentation
Indhold
Startside
Oversigt
IXLSFont
XLS color model
Startside
Indhold
Oversigt
SetThemeColor method (Font)
Sets the font color to one of the 12 Office theme color slots with an optional tint adjustment. Theme companion of Font.Color — use it when the application wants to follow the workbook theme palette instead of pinning a literal RGB. Available since v2.61.0 (chart backlog wave D phase 4)
Syntaks
procedure SetThemeColor(ThemeIdx: Word; Tint: Double);
Parametre
ThemeIdx — 0-based theme slot
(0=lt1, 1=dk1, 2=lt2, 3=dk2, 4..9=accent1..6, 10=hlink, 11=foHlink)
Tint — spec-style lighter/darker adjustment in the range -1.0 .. +1.0
Encoded into the XFExt FullColorExt as a Q15 signed integer in nTintShade
Bemærkninger
The setter behaves identically to Interior.SetThemeColor, but writes the rsFont slot of the XFExt $087D extType ($000D). The Font XF entry still receives a best-match indexed icv so Excel 97-2003 sees an approximation; Excel 2007+ recovers the exact theme idx + tint from the XFExt FullColorExt slot
Reading back via Font.Color returns the RGB resolved through the workbook's BIFF theme palette, so the application always sees a concrete LongWord regardless of whether the original setter was RGB or theme based
Eksempel
Tags an audit column with accent3 + tint so the font color tracks the workbook theme
Workbook.Sheets[1].Range['D2', 'D50'].Font.SetThemeColor(6, - 0.25);
Workbook.SaveAs('AuditColumn.xls', xlExcel97);
Se også
grænseflade IXLSFont
IXLSFont.Coloregenskab
IXLSInterior.SetThemeColormetode
IXLSBorder.SetThemeColormetode
Classic XLS color model
Copyright © 2010-2026 losLab Software