What's the difference between lumMod/lumOff and tint/shade in DrawingML colors?

1.9k views Asked by At

What's the difference between setting a shade or tint (e.g. 25% darker, 40% lighter respectively) in DrawingML using the <a:lumMod> and <a:lumOff> tags and doing what seems to produce a similar outcome with the <a:shade> and <a:tint> tags?

In PowerPoint, selecting the 'Accent 1, 40% Lighter' color from the palette picker produces XML like this:

<a:rPr>
  <a:solidFill>
    <a:schemeClr val="accent1">
      <a:lumMod val="60000"/>
      <a:lumOff val="40000"/>
    </a:schemeClr>
  </a:solidFill>
</a:rPr>

Using the API method Brightness like this produces the same XML:

TextRange.Font.Color.Brightness = 0.4

Using the API method TintAndShade like this:

TextRange.Font.Color.TintAndShade = 0.4

produces this XML:

<a:rPr>
  <a:solidFill>
    <a:schemeClr val="accent1">
      <a:tint val="60000"/>
    </a:schemeClr>
  </a:solidFill>
</a:rPr>

and produces a slightly lighter color.

How should I understand what's happening? Why are there two methods that are so similar and why do they behave differently?

1

There are 1 answers

2
Maxim Banaev On

When the color is a shade of the original theme color, the lumMod attribute is the only one of the tags shown here that appears. The tag appears after the tag when the color is a tint of the original.

<a:rPr>
  <a:solidFill>
    <a:schemeClr val="accent1">
      <a:lumMod val="60000"/>
      <a:lumOff val="40000"/>
    </a:schemeClr>
  </a:solidFill>
</a:rPr>

This means that you get color from ColorTheme by val accent1 (let will be RGb(91, 155, 213)). Then you must change luminence of this color. You can convert it in HSL(208.5°, 59.2, 59.6) And modify luminance = (luminance/100)*(lumMod/100_000) + (lumOff/100_000) Get new HSL Color (HSL(208.5°, 59.2, 75.7) -> RGB(156, 195, 230)

For a shade, the equation is luminance * %tint. For a tint, the equation is luminance * %tint + (1-%tint). (Note that 1-%tint is equal to the lumOff value in DrawingML.)

Check this article.