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