Overview

The Beep theme system powers the visual appearance of every control. It consists of:

  • IBeepTheme — Interface defining the theme contract (in TheTechIdea.Beep.Vis.Modules2.0)
  • BeepTheme — Central partial class with 35+ partial files, each handling a control type
  • Theme Types — Concrete implementations: Ubuntu, GNOME, Cyberpunk, Candy, Zen
  • BeepThemesManager — Singleton manager for theme registration and switching

IBeepTheme Contract

public interface IBeepTheme
{
    string ThemeName { get; }
    Color ButtonBackColor { get; }
    Color ButtonForeColor { get; }
    Color ButtonBorderColor { get; }
    Color ButtonHoverColor { get; }
    // ... 200+ color/style properties for every control type
    Font DefaultFont { get; }
    Font TitleFont { get; }
    int BorderRadius { get; }
    float Opacity { get; }
}

BeepTheme Partial Class (35 Files)

Each partial file handles a specific control type:

FileControl TypeProperties
BeepTheme.cs / Core.cs / Utility.csBaseName, fonts, borders, opacity
BeepTheme.Buttons.csButtonBackColor, ForeColor, Border, Hover, Pressed, Disabled
BeepTheme.TextBox.csTextBoxBackColor, ForeColor, Border, Focused, Placeholder
BeepTheme.ComboBox.csComboBoxField, dropdown, popup colors
BeepTheme.CheckBox.csCheckBoxCheck mark, box border, fill colors
BeepTheme.RadioButton.csRadioButtonCircle border, dot colors
BeepTheme.Grid.csGridHeader, cell, alternating row, selection colors
BeepTheme.Chart.csChartSeries palette, axis, legend colors
BeepTheme.Calendar.csCalendarCell, header, today, event colors
BeepTheme.Tab.csTabsActive, inactive, hover, border colors
BeepTheme.Stepper.csStepperStep node, connector, label colors
BeepTheme.Tree.csTreeViewNode, expander, selection colors
BeepTheme.Menu.csMenuBar, item, hover, separator colors
BeepTheme.Navigation.csNavigationSidebar, nav item colors

Plus 22 more: Dialog, Login, Dashboard, StatusBar, ToolTip, FontAndTypography, Gradient, ColorPalette, Company, BlockquoteCode, Badge, Link, SideMenu, StarRating, StatsCard, TaskCard, Testimony, ScrollList, Card, ScrollBar, Switch, ProgressBar, Miscellaneous.

Theme Types

ThemeProjectFilesStyle
UbuntuThemeControls26 partial filesUbuntu Linux aesthetic — orange accents, dark/light variants
GNOMEThemeControls30 partial filesGNOME desktop — Adwaita colors, rounded corners
CyberpunkThemeControls30 partial filesNeon cyberpunk — bright magenta/cyan, dark backgrounds
CandyThemeVis.Modules2.01 fileSoft candy colors — pastels, rounded shapes
ZenThemeVis.Modules2.01 fileMinimal zen — earth tones, clean typography
CyberpunkNeonThemeVis.Modules2.05 partial filesNeon variant — brighter, more saturated

Token Resolution

// Token resolution pipeline:
// 1. Control checks its own theme property override
// 2. Falls back to BeepThemesManager.CurrentTheme
// 3. Falls back to default theme values

public Color GetButtonBackColor(BaseControl control)
{
    if (control.ThemeOverrides?.ButtonBackColor != null)
        return control.ThemeOverrides.ButtonBackColor;

    return BeepThemesManager.CurrentTheme
        ?.ButtonBackColor ?? DefaultTheme.ButtonBackColor;
}

Examples

// Global theme switch
BeepThemesManager.Instance.SetTheme("DarkTheme");
// All controls update automatically

// Per-control override
myButton.ThemeOverrides = new ThemeOverrides
{
    ButtonBackColor = Color.Red,
    BorderRadius = 12
};

// Custom theme
var myTheme = new BeepTheme
{
    ThemeName = "MyCustomTheme",
    ButtonBackColor = Color.Navy,
    ButtonForeColor = Color.White,
    // ... configure all properties
};
BeepThemesManager.Instance.RegisterTheme(myTheme);