Skip to content
ChartForgeX
Class

VisualTheme

ChartForgeX.Themes

Namespace
ChartForgeX.Themes
Assembly
ChartForgeX
Modifiers
sealed

A paired immutable theme shared by charts, diagrams and future composition packages.

Inheritance

  • object
  • VisualTheme

Usage

Explore 115 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 74

Constructors

public VisualTheme(VisualDesignTokens light, VisualDesignTokens dark, VisualTypography? typography = null, double spacing = 12, double seriesStrokeWidth = 2, double markerRadius = 4, double areaOpacity = 0.12, double barRadius = 4, double gridStrokeWidth = 1, double axisStrokeWidth = 1, double cardRadius = 3, double cardShadowOpacity = 0, ChartColor? cardShadowColor = null, double gaugeStrokeWidth = 14, double gaugeBandWidth = 4, double plotRadius = 3) #

Creates a paired theme from independent token snapshots and geometry settings.

Parameters

light ChartForgeX.Themes.VisualDesignTokens required
dark ChartForgeX.Themes.VisualDesignTokens required
typography ChartForgeX.Themes.VisualTypography? = null optional
spacing double = 12 optional
seriesStrokeWidth double = 2 optional
markerRadius double = 4 optional
areaOpacity double = 0.12 optional
barRadius double = 4 optional
gridStrokeWidth double = 1 optional
axisStrokeWidth double = 1 optional
cardRadius double = 3 optional
cardShadowOpacity double = 0 optional
cardShadowColor ChartForgeX.Primitives.ChartColor? = null optional
gaugeStrokeWidth double = 14 optional
gaugeBandWidth double = 4 optional
plotRadius double = 3 optional

Methods

public static VisualTheme Accessible() #

Creates the Graphite theme with a palette that colorblind readers can tell apart.

public VisualTheme Configure(Action<VisualThemeBuilder> configure) #

Creates a new immutable theme by configuring an independent builder.

Parameters

configure System.Action<ChartForgeX.Themes.VisualThemeBuilder> required
public static VisualTheme FromJson(string json) #

Loads a version 1 paired theme, including canonical palettes, typography and geometry.

Parameters

json string required
The case-sensitive versioned theme document, at most one MiB of characters.

Returns

VisualTheme An immutable theme snapshot.

Exceptions

  • ArgumentException – The document is malformed, unsupported, incomplete or outside input limits.
public static VisualTheme FromPaletteJson(string json, VisualTypography? typography = null) #

Creates a theme from generated HtmlForgeX palettes and optional shared visual primitives.

Parameters

json string required
typography ChartForgeX.Themes.VisualTypography? = null optional
public static VisualTheme Graphite() #

Gets the Graphite layout preset with the canonical HtmlForgeX light/dark colors.

public VisualThemeColors Resolve(ThemeMode mode) #

Resolves the selected immutable color snapshot. ThemeMode.Auto resolves to the light colors.

Parameters

mode ChartForgeX.ThemeMode required
public string ToJson() #

Exports the complete paired color, typography and geometry theme using schemaVersion 1.

Returns

string A deterministic JSON document suitable for VisualTheme.FromJson.
public static VisualTheme TransparentOverlay() #

Creates the Graphite theme with transparent backgrounds for drawing over imagery and wallpapers.

public VisualTheme WithFontFamily(string family) #

Creates a theme with the supplied family and all other typography preserved.

Parameters

family string required
public VisualTheme WithMinimumReadableTextSize(double size) #

Creates a theme whose readable diagram layouts keep text at or above size pixels.

Parameters

size double required
WithPalette 2 overloads
public VisualTheme WithPalette(ThemeMode mode, params ChartColor[] colors) #

Creates a theme with a categorical palette for one explicit mode.

Parameters

mode ChartForgeX.ThemeMode required
colors ChartForgeX.Primitives.ChartColor[] required
public VisualTheme WithPalette(params ChartColor[] colors) #

Creates a theme with the supplied categorical palette in both modes.

Parameters

colors ChartForgeX.Primitives.ChartColor[] required
public VisualTheme WithTypography(VisualTypography typography) #

Creates an independent paired theme with the supplied typography and the same colors, geometry and effects.

Parameters

typography ChartForgeX.Themes.VisualTypography required
The complete font scale to use for the new theme.

Properties

public VisualTypography Typography { get; } #

Gets the typography scale.

public double Spacing { get; } #

Gets the standard layout gap.

public double SeriesStrokeWidth { get; } #

Gets the default data-line width.

public double MarkerRadius { get; } #

Gets the default point radius.

public double AreaOpacity { get; } #

Gets the area fill opacity on light surfaces (0.12 by default).

public double BarRadius { get; } #

Gets the bar corner radius.

public double MaximumBarWidth { get; } #

Gets the maximum regular bar thickness in drawing pixels (64 by default).

public double CardRadius { get; } #

Gets the shared outer card corner radius, independent of plot and data mark radii.

public double PlotRadius { get; } #

Gets the plot surface corner radius, independent of card and mark radii.

public double CardShadowOpacity { get; } #

Gets the shared card shadow opacity. Zero keeps the default flat surface.

public ChartColor CardShadowColor { get; } #

Gets the shared card shadow color, including its authored alpha.

public double GridStrokeWidth { get; } #

Gets the guide width.

public double AxisStrokeWidth { get; } #

Gets the axis width.

public double GaugeStrokeWidth { get; } #

Gets the gauge track and value stroke width.

public double GaugeBandWidth { get; } #

Gets the gauge threshold band width.

public IReadOnlyDictionary<ChartSeriesKind, VisualSeriesDefaults> SeriesDefaults { get; } #

Gets independent copies of the per-kind series defaults, keyed by series kind.