Welcome to OpenXML Developer Sign in | Join | Help

Tint

Last post 06-03-2008, 5:08 AM by Nitin. 3 replies.
Sort Posts: Previous Next
  •  05-31-2007, 2:47 PM 1627

    Tint

    I've been investigating how to apply tint in DrawingXML and the results I'm getting don't make sense based on the documentation.  The ECMA spec defines a 10% tint as 10% of the colour mixed with 90% white.  But I can't get this formula to work.  Also note that this won't work for white - 10% of white plus 90% of white will be 100% white, which is not what (for example) Excel shows in Charts.

    I also noted that a 90% black is more about what I would eyeball as a 70% black.  It turns out that I wasn't completely off, as I went from 0% tinted black all the way to 10%, I could see the colour change was more pronounced at the beginning, and less so at the end.  For example, the R (of the RGB) went from 0 to 89 when I put 90% tint, but it went from  231 to 243 when I went from 20% to 10% tint.  This is not linear.  Actually, 89/255 = 0.34 which is why I was guessing 70% instead of 90%.

    I also looked at the hue, saturation, and luminance, and though only the luminance changed, it too was not linear.  It first made a jump of 84, then a jump of 33, followed by 33, till at last it made a jump of 12 when it went from 20% to 10%.

    Now the documentation was exactly correct when it described how to apply tint in SpreadsheetML, all my Spreadsheet cells show up correctly.  But the documentation doesn't make any sense for DrawingML, all my drawing objects, including charts, show up wrong. 

    Does anyone know what the correct calculation would be?  I'll continue to try to work out the exact formula, but is it really that complicated, or am I missing something that should be obvious?

    Thanks in advance!

  •  08-01-2007, 9:48 AM 1849 in reply to 1627

    Re: Tint

    ((bumping the message up as it no longer shows on the board's default view))

    Does no one have any ideas??  This is causing me to have colours that are far darker than they should be, and is making implementing charts difficult, especially since the chart styles documentation (starting page 4151) is not 100% accurate in the tint values.

    I'm not the only one with this problem, as this post here - http://openxmldeveloper.org/forums/thread/1505.aspx describes the same problem.  The formula mentioned by hqian might work in DocumentML, but it won't work in DrawingML, and not will it work in SpreadsheetML where the transform needs to be applied to the luminosity and not the RGB values. 

    I can live with three different ways of applying tint, but only if they are all documented accurately.  No one has time to reverse engineer the same thing three times!

    Thanks.

  •  10-17-2007, 3:23 AM 2280 in reply to 1849

    Re: Tint

    Andrea:

    I'm not the only one with this problem, as this post here - http://openxmldeveloper.org/forums/thread/1505.aspx describes the same problem.  The formula mentioned by hqian might work in DocumentML, but it won't work in DrawingML, and not will it work in SpreadsheetML where the transform needs to be applied to the luminosity and not the RGB values. 

    Hi all,

    I have the same problem but with the calculation of the shade elements beacuase in drawingML the formula of the percentages doesn't work. This thing is driving me nuts and it seems that nobody cares. It's incredible that Microsoft documentation is so...painful. Thanks

    G.M.

  •  06-03-2008, 5:08 AM 3291 in reply to 2280

    Re: Tint

    Hello Everybody,

    I am facing the same problem. Both with Shade and Tint. I had to write interpolation curves to sort out the problem at my end (Well its not full proof). Do we have any handle on this issue from the Microsoft for correct methodology or the wrong interpretation of the ECMA standand by them, whatever is the case.

    Thanks
View as RSS news feed in XML