none
Default Ribbon colors RRS feed

  • Question

  • In the Windows Ribbon Framework, I'd like to let the users set the three colors of the ribbon that can be modified, but I'd also like to load them back when the options dialog is opened. I'm keeping track of the colors separately in a settings file to load them, but the first time the ribbon has the default blue look, i.e. the user has not chosen them so I don't know the color values. What 3 colors are used exactly by default?

    Thanks.

    Saturday, December 11, 2010 3:06 PM

Answers

  • In the end, I managed to obtain the values myself.

    I used the following code, it uses the .NET wrapper by Arik Poznanski:

     

        Dim f As RibbonLib.Interop.IPropertyStore = _ribbon.Framework
        Dim v As New RibbonLib.Interop.PropVariant
        f.GetValue(RibbonLib.Interop.RibbonProperties.GlobalBackgroundColor, v)
        Dim t = v.Value
        Dim hsl As New HSL
        hsl.H = (t And 255) / 255
        hsl.S = (t >> 8 And 255) / 255
        hsl.L = Math.Pow(Math.E, ((t >> 16 And 255) - 257.7) / 149.9)
        Dim rgb1 = colorhelper.ColorHelper.HSL2RGB(hsl)
    

     

    It resulted in the following three colors which are used by default (RGB):

    Background - 224; 234; 245

    Highlight - 245; 236; 224

    Text - 97; 129; 166

    Hope it will help someone else too.

    • Marked as answer by pimpimpim Saturday, December 11, 2010 5:55 PM
    Saturday, December 11, 2010 5:55 PM