none
What order does Office apply shade/tint/huemod/satmod/lummod color modifiers? RRS feed

  • Question

  • In one of the PowerPoint documents I have, there is this snippet of XML:

    <a:schemeClr val="phClr">
      <a:shade val="69000"/>
      <a:hueMod val="108000"/>
      <a:satMod val="164000"/>
      <a:lumMod val="74000"/>
    </a:schemeClr>

    I've looked through these forums and done various web searches to find out how to correctly calculate the color PowerPoint comes up with from these settings, but to no avail. Would the Office team mind providing answers to this question?

    1) How does PowerPoint determine what color to use for 'phClr'?

    OOXML Part 4, Section 5.1.12.54 (ST_SchemeColorVal) has this incredibly useless definition of 'phClr': "A color used in theme definitions which means to use the color of the style." What style? Which color in the style?

    2) Once I figure out what 'phClr' is, what order do I apply the shade/hueMod/satMod/lumMod modifiers in?

    I've tried assuming that 'phClr' is RGB(0, 0, 0), and that the modifiers should be applied in the order: tint->shade->hueMod->hueOff->satMod->satOff->lumMod->lumOff, but that doesn't come up with the correct answer.

    Thanks for your help!

    - devfw

    Tuesday, March 25, 2014 6:31 PM

Answers

  • Hi devfw,

    I’ll answer your first question soon.
    This is regarding the second question, the color defining, modifying elements and attributes are applied in that order as they are in the presentation.

    Thanks, Vilmos
    Thursday, May 8, 2014 7:04 PM
  • Hi devfw,

    Your interpretation of the answer to your second question is correct.

    This is regarding the first question, you asked:
                        <a:schemeClr val="phClr">  <!-- Where is the color ? -->
                          <a:shade val="69000"/>
                          <a:hueMod val="108000"/>
                          <a:satMod val="164000"/>
                          <a:lumMod val="74000"/>
                        </a:schemeClr>
    ISO/IEC 29500-1:2012(E) in section “20.1.2.3.29 schemeClr (Scheme Color)” states: The possible values for this (val) attribute are defined by the ST_SchemeColorVal simple type (§20.1.10.53).

    20.1.10.53 ST_SchemeColorVal (Scheme Color) states: phClr (Style Color) - A color used in theme definitions which means to use the color of the style.

    “the color of the style” can be found in package “slideMaster1.xml”
              <p:bg>
                <p:bgRef idx="1003">
                  <a:schemeClr val="bg2"/>
                </p:bgRef>
              </p:bg>
    A few lines below you can see that “bg2” is mapped to “dk2”
            <p:clrMap bg1="dk1" tx1="lt1"
                      bg2="dk2" tx2="lt2"
                      accent1="accent1" accent2="accent2" accent3="accent3"
                      accent4="accent4" accent5="accent5" accent6="accent6"
                      hlink="hlink" folHlink="folHlink"/>
    “dk2” is defined in package “theme1.xml”; if you increase, e.g. the red part of it:
                <a:dk2>
                  <!--  ORIGINAL
                  <a:srgbClr val="1E5155"/> -->
                  <a:srgbClr val="785155"/>
                </a:dk2>
    you will see that the color in your sample presentation became more red.

    Thanks, Vilmos
    Wednesday, May 14, 2014 12:37 AM
  • Hi devfw,

    If we delete / comment out the schemeClr element from bgRef, then no color, i.e. black is used by PowerPoint as the color of the style.

    Thanks, Vilmos
    Monday, June 2, 2014 4:36 PM

All replies

  • Hi,

    Thank you for this question. One of our engineers will review this and follow-up.

    Thanks,

    Edgar

    Tuesday, March 25, 2014 6:55 PM
    Moderator
  • Hi devfw,

    I am the engineer who will be working with you on this issue. Your posting contains a snippet indicating you have a sample file, in order to see the whole picture, please post the file or send it as attachment to ‘dochelp (at) microsoft (dot) com’ and in the e-mail indicate that it is for me. Be sure that the file doesn’t contain any confidential information.

    Regards,
    Vilmos Foltenyi - MSFT

    Wednesday, March 26, 2014 5:55 PM
  • Vilmos,

    I've just sent the sample file to the requested address and referenced your name in the Subject: line.

    Thanks for your help!

    - devfw

    Wednesday, March 26, 2014 7:33 PM
  • Hi Felix,

    I’ve got the example1.pptx file, I’m going to analyze it and will post the findings here.

    Thanks, Vilmos
    Wednesday, March 26, 2014 9:01 PM
  • Hi devfw,

    This is regarding the second question in your original posting. Why do you think the order of the elements / attributes is relevant? They yield to a point in the color space, regardless which color model is used. Please describe the problem you are facing.

    Thanks, Vilmos

    Wednesday, April 30, 2014 3:35 AM
  • (re: second question) Since the *Mod attributes modulate the color by a certain percentage, it's important to know if the modulations are applied to the original color or the modified (i.e. tinted/shaded) color. Also, according to other answers in these forums, the shade attribute applies to sRGB color values, but the *Mod attributes above apply to HSL color values, so colors need to be converted between color spaces, as well, to perform the correct calculations and get the right values.

    (re: first question) Can you provide an answer for how PowerPoint determines what color to use for 'phClr'? I'm hoping that, since you've asked about the second question, you have an answer to my first one.

    Thanks,

    - devfw


    • Edited by devfw Monday, May 5, 2014 9:05 PM
    Monday, May 5, 2014 6:15 PM
  • Hi devfw,

    I’ll answer your first question soon.
    This is regarding the second question, the color defining, modifying elements and attributes are applied in that order as they are in the presentation.

    Thanks, Vilmos
    Thursday, May 8, 2014 7:04 PM
  • Thanks for your reply, Vilmos!

    So, if I understand your answer to the second question correctly, then in the XML snippet:

    <a:schemeClr val="phClr">
      <a:shade val="69000"/>
      <a:hueMod val="108000"/>
      <a:satMod val="164000"/>
      <a:lumMod val="74000"/>
    </a:schemeClr>

    the color modifications would be applied in the order shade->hueMod->satMod->lumMod, correct? And, if the color modification tags were saved in this order in the XML file:

    <a:schemeClr val="phClr">
      <a:lumMod val="74000"/>
      <a:satMod val="164000"/>
      <a:hueMod val="108000"/>
      <a:shade val="69000"/>
    </a:schemeClr>

    then the modifications would be applied in the order lumMod->satMod->hueMod->shade, correct?

    Thanks again, and I'm looking forward to the answer for the first question!

    - devfw

    Monday, May 12, 2014 10:05 PM
  • Hi devfw,

    Your interpretation of the answer to your second question is correct.

    This is regarding the first question, you asked:
                        <a:schemeClr val="phClr">  <!-- Where is the color ? -->
                          <a:shade val="69000"/>
                          <a:hueMod val="108000"/>
                          <a:satMod val="164000"/>
                          <a:lumMod val="74000"/>
                        </a:schemeClr>
    ISO/IEC 29500-1:2012(E) in section “20.1.2.3.29 schemeClr (Scheme Color)” states: The possible values for this (val) attribute are defined by the ST_SchemeColorVal simple type (§20.1.10.53).

    20.1.10.53 ST_SchemeColorVal (Scheme Color) states: phClr (Style Color) - A color used in theme definitions which means to use the color of the style.

    “the color of the style” can be found in package “slideMaster1.xml”
              <p:bg>
                <p:bgRef idx="1003">
                  <a:schemeClr val="bg2"/>
                </p:bgRef>
              </p:bg>
    A few lines below you can see that “bg2” is mapped to “dk2”
            <p:clrMap bg1="dk1" tx1="lt1"
                      bg2="dk2" tx2="lt2"
                      accent1="accent1" accent2="accent2" accent3="accent3"
                      accent4="accent4" accent5="accent5" accent6="accent6"
                      hlink="hlink" folHlink="folHlink"/>
    “dk2” is defined in package “theme1.xml”; if you increase, e.g. the red part of it:
                <a:dk2>
                  <!--  ORIGINAL
                  <a:srgbClr val="1E5155"/> -->
                  <a:srgbClr val="785155"/>
                </a:dk2>
    you will see that the color in your sample presentation became more red.

    Thanks, Vilmos
    Wednesday, May 14, 2014 12:37 AM
  • Vilmos,

    Thanks for your reply! That explanation makes sense.

    I have one more question: if instead the 'bgRef' tag snippet was this -

              <p:bg>
                <p:bgRef idx="1003">
                </p:bgRef>
              </p:bg>

    what would 'phClr' be? Is there a default color that PowerPoint uses in cases like this?

    Thanks again for your help!

    - devfw

    Wednesday, May 14, 2014 9:39 PM
  • Hi devfw,

    If we delete / comment out the schemeClr element from bgRef, then no color, i.e. black is used by PowerPoint as the color of the style.

    Thanks, Vilmos
    Monday, June 2, 2014 4:36 PM