Class Shading
Represents the shading properties for a table or table cell in a Word document.
Inheritance
Implements
Namespace: IronWord.Models
Assembly: IronWord.dll
Syntax
public class Shading : Object
Filling the background of a table or a span of text with color in a Word document runs through Shading. It describes the fill that sits behind content, the colored backdrop that highlights a table cell, banded row, or run of text. A developer reaches for it when plain white behind text is not enough and a region should stand out with a solid color, a theme color, or a patterned fill.
Shading attaches to the thing it colors: a Table exposes a Shading property and a TextStyle exposes one too, so a developer obtains a shading object from the element being styled rather than constructing it in isolation. That places it in the styling step of building a table or a text style, where the background is decided alongside borders and fonts.
Color and Fill set the foreground and background of the fill directly, while ShadingPattern selects a patterned fill instead of a flat color. The theme-based properties let the fill track the document's theme rather than a fixed value: ThemeColor and ThemeFill bind the foreground and background to theme slots, and ThemeTint, ThemeFillTint, and ThemeFillShade lighten or darken those theme colors by a tint or shade. Choose the explicit Color and Fill for a fixed look that does not change with the theme, or the theme properties when the shading should stay consistent with a document that may be re-themed. For a simple solid background, set Fill; reach for ShadingPattern only when a textured or banded effect is wanted.
using IronWord.Models;
var shading = new Shading();
shading.Fill = Color.LightGray;
shading.ShadingPattern = ShadingPatternValues.Clear;The add table how-to places shaded tables, the style text how-to covers text styling, and the document element tutorial shows how styling fits the document model.
Constructors
Shading()
Declaration
public Shading()
Properties
Color
Gets or sets the color of the shading.
Declaration
public IColor Color { get; set; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.IColor |
Fill
Gets or sets the fill color of the shading.
Declaration
public IColor Fill { get; set; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.IColor |
ShadingPattern
Gets or sets the shading pattern.
Declaration
public Nullable<ShadingPatternValues> ShadingPattern { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<IronSoftware.Abstractions.Word.ShadingPatternValues> |
ThemeColor
Shading Pattern Theme Color
Represents the following attribute in the schema: w:themeColor
Declaration
public IColor ThemeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.IColor |
ThemeFill
Shading Background Theme Color
Represents the following attribute in the schema: w:themeFill
Declaration
public IColor ThemeFill { get; set; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.IColor |
ThemeFillShade
Shading Background Theme Color Shade
Represents the following attribute in the schema: w:themeFillShade
Declaration
public IColor ThemeFillShade { get; set; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.IColor |
ThemeFillTint
Shading Background Theme Color Tint
Represents the following attribute in the schema: w:themeFillTint
Declaration
public string ThemeFillTint { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ThemeTint
Gets or sets the theme tint for the shading.
Declaration
public string ThemeTint { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |