Themes are used to establish a documents identity. They define the colors, fonts, and effects that should be used on elements within the document. Specifically, the paragraph, character, and table styles defined in a document are intended to reference theme colors and fonts. This allows documents to be robust should their design need to change in the future.
The name, colors, fonts, and effects of the default theme provided in
FluentWriter is overridden using the Theme() method:
document.Theme(theme => {
theme
.Name("ACME, Inc.")
.Colors(colors => {/*...*/})
.Fonts(fonts => {/*...*/})
.Effects(EffectStyle.Glossy)
});
Theme colors define a palette that can be referenced when styling elements of a document. There are twelve theme colors: six accent colors, two dark colors, two light colors, a hyperlink color, and a followed hyperlink color. The following code illustrates how these colors are defined when creating a theme while the Colors article these colors can be used.
document.Theme(theme => {
theme.Colors(colors => {
colors
.Dark1("#000") // Dark foreground
.Light1("#fff") // Light foreground
.Dark2("#023047") // Dark background
.Light2("#efefef") // Light background
.Accent1("#8ecae6")
.Accent2("#219ebc")
.Accent3("#023047")
.Accent4("#ffb703")
.Accent5("#fb8500")
.Accent6("#d62839")
.Hyperlink("#219ebc")
.HyperlinkVisited("#9821bc");
});
});

Theme fonts designate what font families should be used for headings and for body text. These fonts are also referred to as the major and minor fonts, respectively.
document.Theme(theme => {
theme.Fonts(fonts => {
fonts
.Headings("Times New Roman")
.Body("Arial")
});
});
Theme effects are set using predefined options matching those available in Microsoft Office:
document.Theme(theme => {
theme.Effects(EffectStyle.Glossy)
});
| Effect | Description |
|---|---|
| EffectStyle.Office |
Default The default style applied by FluentWriter. This is also the style applied to new documents created in Microsoft Office. |
| EffectStyle.OfficeLegacy | The default style used in Microsoft Office from 2007 to 2010. |
| EffectStyle.BandedEdges | |
| EffectStyle.ExtremeShadow | |
| EffectStyle.FrostedGlass | |
| EffectStyle.Glossy | |
| EffectStyle.GlowEdge | |
| EffectStyle.Inset | |
| EffectStyle.MilkGlass | |
| EffectStyle.Reflection | |
| EffectStyle.Riblet | |
| EffectStyle.SmokeyGlass | |
| EffectStyle.SubtleSolids | |
| EffectStyle.TopShadow |