Beispiel #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()
     });
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #4
0
 public static void ApplyAccent(ThemeColor name)
 {
     new PaletteHelper().ReplaceAccentColor(name.ToString().ToLower());
 }
Beispiel #5
0
 public static void ApplyPrimary(ThemeColor name)
 {
     new PaletteHelper().ReplacePrimaryColor(name.ToString().ToLower());
 }