ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupsBorder.CheckForContextColor C# (CSharp) Method

CheckForContextColor() private method

private CheckForContextColor ( PaletteState state ) : Color
state PaletteState
return Color
        private Color CheckForContextColor(PaletteState state)
        {
            // We need an associated ribbon tab
            if (Ribbon.SelectedTab != null)
            {
                // Does the ribbon tab have a context setting?
                if (!string.IsNullOrEmpty(Ribbon.SelectedTab.ContextName))
                {
                    // Find the context definition for this context
                    KryptonRibbonContext ribbonContext = Ribbon.RibbonContexts[Ribbon.SelectedTab.ContextName];

                    // Should always work, but you never know!
                    if (ribbonContext != null)
                    {
                        // Return the context specific color
                        return ribbonContext.ContextColor;
                    }
                }
            }

            return Color.Empty;
        }