2

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?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
scanny
  • 26,423
  • 5
  • 54
  • 80

1 Answers1

3

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.

Maxim Banaev
  • 886
  • 1
  • 9
  • 22
  • Sorry Maxim, you might want to read the question again, this response doesn't actually address the question, which is: "Why does the API and the XML schema have two different ways of specifying tints/shades and why do they produce different renderings?". – scanny Feb 24 '14 at 21:59
  • 1
    @scanny A bit unfair to downvote him with all the info he provided. If you wanted an answer to the exact question you asked in your comment, you should have asked it like that. So here's the answer - because the COM API and the XML schema are two different things. That's all. – Todd Main Jun 22 '15 at 08:48