none
How do we calculate the color "auto"? RRS feed

  • Question

  • Hi all;

    In 17.18.38 it defines auto auto as:

    This color therefore can be automatically be modified by a consumer as appropriate, for example, in order to ensure that the border can be distinguished against the page's background color.

    We need to duplicate what Word is doing. Is there any guidance on how Word decides this?

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Monday, April 18, 2016 8:21 PM

Answers

  • Closing the loop on this thread...

    We found that this issue is much more complex than we originally thought since there are several different elements that can make use of the 'auto' color. We narrowed the scope down to when Word decides to switch between black and white for a gray background. Word examines the luminescence value with 60 being the threshold. Note that this is only true when the saturation is 0.

    I have filed a request to have additional information added to MS-OI29500 about this.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Thursday, June 8, 2017 7:48 PM
    Moderator
  • Hello Barry –

     As stated earlier; the actual rendering algorithm within Word is out of scope for the ISO-29500 and ECMA-376 documentation sets -- we do not guarantee any specific rendering consistency between versions of Word, or even within the same version of Word. I can share some insights about how Word currently renders. Please note that this behavior is not covered by our specification and can be changed anytime without any notification. Today, Word uses the following algorithm to calculate background and foreground color brightness - http://www.w3.org/TR/AERT/#color-contrast. If Word detects shading and background color to be darker (Luminance Val < 60) than foreground color, then it invert the colors. Word currently uses only black or white color as light and dark color.

     

    I hope that this above information will help you understand the logic behind ‘auto’ color handling in word.

     

    Thanks


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Tuesday, February 20, 2018 11:33 PM

All replies

  • Hi Dave,

    Thank you for your question.  An engineer from the Protocols team will contact you soon.


    Jeff McCashland | Microsoft Protocols Open Specifications Team

    Monday, April 18, 2016 8:37 PM
    Moderator
  • Hi Dave, I am the engineer who will be working with you on this issue. I am currently researching the problem and will provide you with an update soon. Thank you for your patience.

    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Monday, April 18, 2016 9:25 PM
    Moderator
  • Closing the loop on this thread...

    We found that this issue is much more complex than we originally thought since there are several different elements that can make use of the 'auto' color. We narrowed the scope down to when Word decides to switch between black and white for a gray background. Word examines the luminescence value with 60 being the threshold. Note that this is only true when the saturation is 0.

    I have filed a request to have additional information added to MS-OI29500 about this.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Thursday, June 8, 2017 7:48 PM
    Moderator
  • Hi Dave,

    I want to touch base back on this question and provide the results of Josh's investigation work. 

    As you have heard from us previously. The actual rendering within Word is generally out of scope for the ISO-29500 and ECMA-376 documentation sets. 

    However, in essence how Word behaves in this scenario is to base the foreground color upon the background color. Word determines the background and any background shading. If the background is dark then the foreground color is set to a light color, functionally White. If the background is light then the foreground color is set to a dark color, functionally Black. 

    Will Gregg | open specifications

    Tuesday, November 7, 2017 9:15 PM
    Moderator
  • Is there anywhere an exact formula that describes MS Word behavior for "auto" color's rendering?

    For the following background color, "auto" is "black":

    R: 148
    G: 0
    B: 148

    For the following background color, "auto" is "white":

    R: 147
    G: 0
    B: 147

    However, when converting them to HSL color model, MS Word shows the same value:

    H: 213
    S: 255
    L: 74

    See:


    • Edited by Barry_Sharp Tuesday, February 6, 2018 7:10 AM
    Tuesday, February 6, 2018 7:10 AM
  • Hi Barry,

    Thank you for your question.  An engineer from the protocols team will contact you soon.


    Bryan S. Burgin Senior Escalation Engineer Microsoft Protocol Open Specifications Team

    Tuesday, February 6, 2018 4:42 PM
    Moderator
  • Hello Barry -

    I am currently researching the problem and will provide you with an update soon.

    Thanks


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Tuesday, February 6, 2018 5:43 PM
  • Hello Barry –

     As stated earlier; the actual rendering algorithm within Word is out of scope for the ISO-29500 and ECMA-376 documentation sets -- we do not guarantee any specific rendering consistency between versions of Word, or even within the same version of Word. I can share some insights about how Word currently renders. Please note that this behavior is not covered by our specification and can be changed anytime without any notification. Today, Word uses the following algorithm to calculate background and foreground color brightness - http://www.w3.org/TR/AERT/#color-contrast. If Word detects shading and background color to be darker (Luminance Val < 60) than foreground color, then it invert the colors. Word currently uses only black or white color as light and dark color.

     

    I hope that this above information will help you understand the logic behind ‘auto’ color handling in word.

     

    Thanks


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Tuesday, February 20, 2018 11:33 PM
  • This is fantastic - thanks

    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Wednesday, February 21, 2018 2:23 AM