Example #1
0
 public static string ToBackgroundColorCss(this ThemeColor themeColor)
 {
     return(themeColor switch
     {
         ThemeColor.None => null,
         ThemeColor.Link => throw new NotSupportedException($"{nameof(ThemeColor)}.{nameof(ThemeColor.Link)} cannot be used as background color."),
         _ => "bg-" + themeColor.ToString("f").ToLower()
     });
Example #2
0
        void AddThemeColor(RibbonItemCollection items, ThemeColor themeColor)
        {
            RibbonToggleButton tb = new RibbonToggleButton();

            tb.Text            = themeColor.ToString();
            tb.Tag             = themeColor;
            tb.ToggleGroupName = "Theme";
            tb.CanDepress      = false;
            items.Add(tb);
        }
Example #3
0
        public override string ToString()
        {
            if (ColorType == XLColorType.Color)
            {
                return(Color.ToHex());
            }

            if (ColorType == XLColorType.Theme)
            {
                return(String.Format("Color Theme: {0}, Tint: {1}", ThemeColor.ToString(), ThemeTint.ToString()));
            }

            return("Color Index: " + Indexed);
        }
Example #4
0
 public static void ApplyAccent(ThemeColor name)
 {
     new PaletteHelper().ReplaceAccentColor(name.ToString().ToLower());
 }
Example #5
0
 public static void ApplyPrimary(ThemeColor name)
 {
     new PaletteHelper().ReplacePrimaryColor(name.ToString().ToLower());
 }