Theme colors (ThemeColor) allow document authors to reference colors as
variables. This makes styling easier, consistent, and dynamic. The following
table lists the theme colors available:
| Theme Color | Description |
|---|---|
| ThemeColor.Dark1 | Dark 1 - The primary dark color. In Microsoft Office this color is depicted as the foreground color for light backgrounds (specifically on ThemeColor.Light2). |
| ThemeColor.Light1 | Light 1 - The primary light color. In Microsoft Office this color is depicted as the foreground color for dark backgrounds (specifically on ThemeColor.Dark2). |
| ThemeColor.Dark2 | Dark 2 - The secondary dark color. In Microsoft Office this color is depicted as the dark background color. |
| ThemeColor.Light2 | Light 2 - The secondary dark color. In Microsoft Office this color is depicted as the light background color. |
| ThemeColor.Accent1 | Accent 1 - The primary brand color. |
| ThemeColor.Accent2 | Accent 2 - The secondary brand color. |
| ThemeColor.Accent3 | Accent 3 - The tertiary brand color. |
| ThemeColor.Accent4 | Accent 4 - Supporting accent color. |
| ThemeColor.Accent5 | Accent 5 - Supporting accent color. |
| ThemeColor.Accent6 | Accent 6 - Supporting accent color. |
| ThemeColor.Hyperlink | The color of hyperlinked text. |
| ThemeColor.FollowedHyperlink | The color of hyperlinked text that has been clicked/visited. |
Tints create lighter versions of a theme color by adding white. A tint of 10% is 10% of the input color combined with 90% white.
section.Paragraph(p =>
{
p.Text("████").FontColor(ThemeColor.Accent1);
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint90));
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint80));
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint70));
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint60));
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint50));
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint40));
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint30));
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint20));
p.Text("████").FontColor(ThemeColor.Accent1.Tint(Tints.Tint10));
});
████ ████ ████ ████ ████ ████ ████ ████ ████ ████
The Tints class contains properties for quickly specifying tints in 10%
increments. If necessary, a custom tint can be specified by constructing a
new Tint and passing the desired percentage of the input color:
section.Paragraph("35% Tint").FontColor(ThemeColor.Accent1.Tint(new Tint(0.35));
Shades are the opposite of tints, they create darker versions of a theme color by adding black. A shade of 10% is 10% of the input color combined with 90% black.
section.Paragraph(p =>
{
p.Text("████").FontColor(ThemeColor.Accent1);
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade90));
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade80));
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade70));
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade60));
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade50));
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade40));
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade30));
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade20));
p.Text("████").FontColor(ThemeColor.Accent1.Shade(Shades.Shade10));
});
████ ████ ████ ████ ████ ████ ████ ████ ████ ████
Similar to the Tints class, the Shades class contains properties for quickly
creating shades in 10% increments. A custom shade is specified by
constructing a new Shade and passing the desired percentage of the input
color:
section.Paragraph("35% Shade").FontColor(ThemeColor.Accent1.Shade(new Shade(0.35));