Class ThemeColorMath
- Namespace
- DocWright.Core.Primitives
- Assembly
- DocWright.Core.dll
The transforms WordprocessingML applies to a theme colour: w:themeTint and w:themeShade modulate
luminance in HSL space with the result truncated per channel (WQ-0001: accent 4472C4 with themeTint 99 yields
8EAADB, with themeShade BF yields 2F5496). Here, below layout, so that an edit that recolours a document through
its theme writes the same cached colour the resolver draws (Phase 159).
public static class ThemeColorMath
- Inheritance
-
ThemeColorMath
- Inherited Members
Methods
- ApplyShade(ColorRgb, byte)
Applies a
w:themeShade: luminance moves toward black in HSL space (L' = L·shade/255); 0xFF is identity, 0x00 is black.
- ApplyTint(ColorRgb, byte)
Applies a
w:themeTint: luminance moves toward white in HSL space (L' = 1 − (1 − L)·tint/255); 0xFF is identity, 0x00 is white.
- HueToChannel(double, double, double)
One channel of an HSL colour (the standard hue-to-RGB step).
- RgbToHsl(ColorRgb, out double, out double, out double)
Converts a colour to hue, saturation and lightness, each 0 to 1.