API Reference
VisualDesignTokens
Defines product-neutral brand, semantic color, typography, and shape tokens that can be applied across ChartForgeX visual surfaces.
Inheritance
- Object
- VisualDesignTokens
Usage
Explore 15 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.
Returned or exposed by 6
- Method VisualDesignTokens.Clone
- Method VisualDesignTokens.Dark
- Method VisualDesignTokens.FromJson
- Method VisualDesignTokens.FromJsonFile
- Method VisualDesignTokens.GraphiteDark
- Method VisualDesignTokens.GraphiteLight
Accepted by parameters 9
- Method VisualCanvas.WithDesignTokens
- Method Chart.WithDesignTokens
- Method TerminalDesignTokenExtensions.ApplyTo
- Method VisualCanvasDesignTokenExtensions.ApplyTo
- Extension method VisualDesignTokens.ApplyTo
- Method VisualStoryDesignTokenExtensions.ApplyTo
- Constructor VisualTheme.VisualTheme
- Constructor VisualTheme.VisualTheme
- Method TopologyChart.WithDesignTokens
Constructors
public VisualDesignTokens() #Methods
public ChartTheme ApplyTo(ChartTheme theme) #ChartThemeApplies the shared tokens to a chart renderer theme.
Parameters
- theme ChartForgeX.Themes.ChartTheme
public TopologyTheme ApplyTo(TopologyTheme theme) #TopologyThemeApplies the shared tokens to a topology renderer theme.
Parameters
- theme ChartForgeX.Topology.TopologyTheme
public static VisualDesignTokens Dark() #VisualDesignTokensCreates a dark token set suitable for reports, dashboards, and wallpapers.
public static VisualDesignTokens FromJson(String json, VisualThemeMode mode = Light) #VisualDesignTokensLoads tokens from the generated design-token JSON (the HtmlForgeX design tokens 1.x; 1.1.0 adds the optional ramps). The document holds a light and a dark object, each with surface, text, chrome, accent, severity (fill and ink), outcome, state, and series, plus optional ramps (sequential: colours weakest to strongest; diverging: negative and positive arms weakest to strongest around a neutral colour). Files without ramps still load. Other top-level members, such as name or notes, are ignored. An optional graphite object in each mode enables the flat look and supplies muted, grid, axis, info, quiet, quietLine, neutral, neutral2, and neutral3 colour roles.
Parameters
- json System.String
- The token document.
- mode ChartForgeX.Themes.VisualThemeMode = Light
- Which variant to load.
Returns
The loaded tokens.
Exceptions
ArgumentNullException– json is null.ArgumentException– The JSON is malformed, too large, has duplicate keys, lacks a required member, or holds a colour that is not #rrggbb or #rrggbbaa. Keys are case-sensitive.
public static VisualDesignTokens FromJsonFile(String path, VisualThemeMode mode = Light) #VisualDesignTokensLoads tokens from a generated design-token JSON file.
Parameters
- path System.String
- The token file path.
- mode ChartForgeX.Themes.VisualThemeMode = Light
- Which variant to load.
Returns
The loaded tokens.
Exceptions
ArgumentException– The path is empty or the content is not a valid token document.IOException– The file cannot be read.
public static VisualDesignTokens GraphiteDark() #VisualDesignTokensCreates the lifted Graphite dark colour roles and ramps.
public static VisualDesignTokens GraphiteLight() #VisualDesignTokensCreates the approved Graphite light colour roles and ramps.
public ChartColorScale? ToSequentialColorScale() #ChartColorScale?Returns a sequential numeric color scale with every ramp color, weakest to strongest, or null without a ramp.
public SvgColorVariables ToSvgColorVariables(Func<String, String?>? variableName = null) #SvgColorVariablesCreates SVG colour variables for these tokens, one per token colour, named from the token path. Paths use the member names of the token JSON with 1-based positions: surface.page, surface.card, surface.cardAlt, surface.line, text.primary, text.secondary, series.1 …, severity.{critical|high|medium|low|info}.{fill|ink}, outcome.{pass|neutral}.{fill|ink}, state.maintenance.{fill|ink}, independent legacy status.{positive|warning|negative|disabled}, accent.base, chrome.accent, ramps.sequential.1 …, ramps.diverging.negative.1 …, ramps.diverging.neutral, and ramps.diverging.positive.1 …. They are added in that order, so when two tokens share a colour the earlier one names a paint without a role. Each variable has the role of its token (SvgColorRole.Surface for surface.*, Text, Series, Status for severity, outcome, and state, Ramp; accents Any), so a renderer that writes a colour for a role names the same token in every theme. Text matched by value never takes a surface token. Paired series.*.ink, ramp ink and state contrast-ink variables let filled-mark labels retain readable contrast when a host switches themes.
Parameters
- variableName System.Func<System.String, System.String?>? = null
- Returns the custom property name for a token path, or null to leave that token literal. Null names every token --cfx- followed by its path in kebab case, for example --cfx-surface-card-alt or --cfx-series-1.
Returns
The colour variables, for Chart.WithSvgColorVariables, ChartGrid.WithSvgColorVariables, or TopologyRenderOptions.SvgColorVariables.
Exceptions
ArgumentException– variableName returned a name that is not a valid custom property name.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public ChartColor Background { get; set; } #Gets or sets the page or canvas background color.
public ChartColor Surface { get; set; } #Gets or sets the recessed surface color.
public ChartColor ElevatedSurface { get; set; } #Gets or sets the elevated card surface color.
public ChartColor Foreground { get; set; } #Gets or sets the primary foreground color.
public ChartColor MutedForeground { get; set; } #Gets or sets the secondary foreground color.
public ChartColor Border { get; set; } #Gets or sets the guide and border color.
public ChartColor Accent { get; set; } #Gets or sets the primary accent color.
public ChartColor SecondaryAccent { get; set; } #Gets or sets the secondary accent color.
public ChartColor Positive { get; set; } #Gets or sets the positive semantic color.
public ChartColor Warning { get; set; } #Gets or sets the warning semantic color.
public ChartColor Negative { get; set; } #Gets or sets the negative semantic color.
public ChartColor Disabled { get; set; } #Gets or sets the disabled semantic color.
public ChartColor[] Palette { get; set; } #Gets or sets the qualitative data palette.
public String FontFamily { get; set; } #Gets or sets the primary CSS-compatible font family stack.
public String MonospaceFontFamily { get; set; } #Gets or sets the CSS-compatible monospace font family stack.
public Double CornerRadius { get; set; } #Gets or sets the base corner radius.
public Double StrokeWidth { get; set; } #Gets or sets the base data-mark stroke width.
public VisualStatusTokens Status { get; set; } #Gets or sets the severity, outcome, and operational-state colours. Use VisualStatusTokens.OperationalStateCategories and related methods with Chart.WithStateCategories.
public ChartColor[]? SequentialRamp { get; set; } #Gets or sets the optional sequential ramp (weakest to strongest, one hue) for counts and magnitudes. Applied to ChartTheme.SequentialRamp; null clears it so heatmaps use the default blend.
public VisualDivergingRamp? DivergingRamp { get; set; } #Gets or sets the optional diverging ramp for values around a midpoint (see VisualDivergingRamp.ToColorScale).
public Boolean UseGraphiteLayout { get; set; } #Gets or sets whether charts use the flat Graphite look when these tokens are applied.
public ChartColor? Muted { get; set; } #Gets or sets muted annotation text; null retains the secondary foreground mapping.
public ChartColor? Grid { get; set; } #Gets or sets horizontal plot guides; null retains the border-derived mapping.
public ChartColor? Axis { get; set; } #Gets or sets the zero baseline; null retains the secondary-text-derived mapping.
public ChartColor? Info { get; set; } #Gets or sets the informational state colour.
public ChartColor? Quiet { get; set; } #Gets or sets a quiet healthy fill.
public ChartColor? QuietLine { get; set; } #Gets or sets an understated healthy line.
public ChartColor? Neutral { get; set; } #Gets or sets the neutral aggregate fill.
public ChartColor? Neutral2 { get; set; } #Gets or sets the neutral track fill.
public ChartColor? Neutral3 { get; set; } #Gets or sets the neutral zero-cell fill.
Extension Methods
public static TerminalTheme ApplyTo(VisualDesignTokens tokens, TerminalTheme theme) #TerminalThemeMaps shared surfaces, monospace typography and output tones onto an existing terminal theme. Semantic output uses status inks suitable for text on the content surface, rather than mark fills. Apply caller-specific overrides after this mapping.
Parameters
- tokens ChartForgeX.Themes.VisualDesignTokens
- theme ChartForgeX.Terminal.TerminalTheme
public static VisualStoryTheme ApplyTo(VisualDesignTokens tokens, VisualStoryTheme theme) #VisualStoryThemeMaps shared surfaces, typography and text roles onto an existing story theme. Success uses the status ink for text; syntax uses the data palette, falling back to primary text when a palette color has less than 4.5:1 contrast on the panel. Apply caller-specific overrides after this mapping.
Parameters
- tokens ChartForgeX.Themes.VisualDesignTokens
- theme ChartForgeX.Stories.VisualStoryTheme
public static VisualCanvasTheme ApplyTo(VisualDesignTokens tokens, VisualCanvasTheme theme) #VisualCanvasThemeMaps shared colors and typography onto an existing canvas theme.
Parameters
- tokens ChartForgeX.Themes.VisualDesignTokens
- theme ChartForgeX.Composition.VisualCanvasTheme