简体   繁体   English

DrawingML 颜色中的 lumMod/lumOff 和 tint/shade 有什么区别?

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

What's the difference between setting a shade or tint (eg 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?使用<a:lumMod><a:lumOff>标签在 DrawingML 中设置阴影或色调(例如分别深 25%,浅 40%)与使用<a:lumMod>执行似乎产生类似结果的操作之间有什么<a:lumOff> <a:shade><a:tint>标签?

In PowerPoint, selecting the 'Accent 1, 40% Lighter' color from the palette picker produces XML like this:在 PowerPoint 中,从调色板选择器中选择“Accent 1, 40% Lighter”颜色会生成如下 XML:

<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:像这样使用 API 方法 Brightness 会生成相同的 XML:

TextRange.Font.Color.Brightness = 0.4

Using the API method TintAndShade like this:像这样使用 API 方法 TintAndShade:

TextRange.Font.Color.TintAndShade = 0.4

produces this XML:生成此 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?为什么有两种方法如此相似,为什么它们的行为不同?

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.当颜色是原始主题颜色的阴影时,lumMod 属性是此处显示的唯一一个标签。 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)).这意味着您可以通过 valaccent1 从 ColorTheme 获取颜色(假设为 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)您可以将其转换为 HSL(208.5°, 59.2, 59.6) 并修改亮度 = (luminance/100)*(lumMod/100_000) + (lumOff/100_000) 获取新的 HSL 颜色 (HSL(208.5°, 59.2, 75.7) - > RGB(156, 195, 230)

For a shade, the equation is luminance * %tint.对于阴影,等式是亮度 * %tint。 For a tint, the equation is luminance * %tint + (1-%tint).对于色调,等式是亮度 * %tint + (1-%tint)。 (Note that 1-%tint is equal to the lumOff value in DrawingML.) (请注意,1-%tint 等于 DrawingML 中的 lumOff 值。)

Check this article.检查这篇文章。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM