Table of Contents

Method ApplyDrawingShade

Namespace
DocWright.Layout
Assembly
DocWright.Layout.dll

ApplyDrawingShade(ColorRgb, int)

Applies a DrawingML a:shade transform (§20.1.2.3.31): the color is multiplied toward black in linear RGB, not HSL.

public static ColorRgb ApplyDrawingShade(ColorRgb color, int shade)

Parameters

color ColorRgb

The base color.

shade int

The shade amount in thousandths of a percent (100000 = identity).

Returns

ColorRgb

The shaded color.

Remarks

This is deliberately not ApplyShade(ColorRgb, byte). WordprocessingML's w:themeShade is an HSL-luminance scale taking a byte; DrawingML's a:shade is a linear-light multiply taking thousandths of a percent. Applying one where the other belongs produces visibly wrong brand colors, so both live here side by side.