background_tint_and_shade property

Shading.background_tint_and_shade property

Gets or sets a double value that lightens or darkens a background theme color.

@property
def background_tint_and_shade(self) -> float:
    ...

@background_tint_and_shade.setter
def background_tint_and_shade(self, value: float):
    ...

Exceptions

exceptioncondition
RuntimeError (Proxy error(ArgumentOutOfRangeException))Throw if set this property to a value less than -1 or more than 1.
RuntimeError (Proxy error(InvalidOperationException))Throw if set this property for Shading object with non-theme colors.

Remarks

The allowed values are in the range from -1 (the darkest) to 1 (the lightest) for this property.

Zero (0) is neutral.

Examples

Shows how to set foreground and background colors for shading texture.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)

shading = doc.first_section.body.first_paragraph.paragraph_format.shading
shading.texture = aw.TextureIndex.TEXTURE_12PT5_PERCENT
shading.foreground_pattern_theme_color = aw.themes.ThemeColor.DARK1
shading.background_pattern_theme_color = aw.themes.ThemeColor.DARK2

shading.foreground_tint_and_shade = 0.5
shading.background_tint_and_shade = -0.2

builder.font.border.color = drawing.Color.green
builder.font.border.line_width = 2.5
builder.font.border.line_style = aw.LineStyle.DASH_DOT_STROKER

builder.writeln("Foreground and background pattern colors for shading texture.")

doc.save(ARTIFACTS_DIR + "Font.ForegroundAndBackground.docx")

See Also