I struggled with this all day. Inside my styles.xml file, I have color information specified like this:
<fgColor theme = "0" tint = "- 0.249977111117893" / ">
ECMA 376 defines a theme color link as:
An index to the <clrScheme> collection referring to a specific <sysClr> or <srgbClr> expressed in the subject part.
Ok, that sounds easy. Here is an excerpt from my clrScheme xml:
<a: clrScheme name = "Office">
<a: DK1>
<a: sysClr val = "windowText" lastClr = "000000" / ">
& L; / a: DK1>
<a: LT1>
<a: sysClr val = "window" lastClr = "FFFFFF" / ">
</ a: lt1>
Index zero is black and they want to darken it? I can tell you that after applying the hue, the color should be # F2F2F2.
My confusion is what theme = "0" really means? It is impossible to mean to obscure # 000000. Checking the MSDN only confuses me even more. From http://msdn.microsoft.com/en-us/library/dd560821.aspx
note that the integer color of the theme starts from left to right in the palette starting from zero. theme color 3 - dark 2 text / background color.
In fact, if you start counting at zero, the third entry is Light 2. Dark 2 is the second. Can anyone here shed light on this subject for me? What does topic = "0" mean?
Here is the VB6 code I worked with to apply the hue. You can paste it into your vba editor and run a test sub.
Public Type tRGB R As Byte G As Byte B As Byte End Type Public Type tHSL H As Double S As Double L As Double End Type Sub TestRgbTint() Dim c As tRGB RGB_Hex2Type "ffffff", c RGB_ApplyTint c, -0.249977111117893 Debug.Print Hex(cR) & Hex(cG) & Hex(cB) End Sub Public Sub RGB_Hex2Type(ByVal HexString As String, RGB As tRGB) 'Remove the alpha channel if it exists If Len(HexString) = 8 Then HexString = mID(HexString, 3) End If RGB.R = CByte("&H" & Left(HexString, 2)) RGB.G = CByte("&H" & mID(HexString, 3, 2)) RGB.B = CByte("&H" & Right(HexString, 2)) End Sub Public Sub RGB_ApplyTint(RGB As tRGB, tint As Double) Const HLSMAX = 1# Dim HSL As tHSL If tint = 0 Then Exit Sub RGB2HSL RGB, HSL If tint < 0 Then HSL.L = HSL.L * (1# + tint) Else HSL.L = HSL.L * (1# - tint) + (HLSMAX - HLSMAX * (1# - tint)) End If HSL2RGB HSL, RGB End Sub Public Sub HSL2RGB(HSL As tHSL, RGB As tRGB) HSL2RGB_ByVal HSL.H, HSL.S, HSL.L, RGB End Sub Private Sub HSL2RGB_ByVal(ByVal H As Double, ByVal S As Double, ByVal L As Double, RGB As tRGB) Dim v As Double Dim R As Double, G As Double, B As Double 'Default color to gray R = L G = L B = L If L < 0.5 Then v = L * (1