API Reference
VisualDesignTokens
Builds product-neutral semantic color palettes. A VisualTheme snapshots these mutable values.
Inheritance
- Object
- VisualDesignTokens
Usage
Explore 13 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 9
- Method VisualDesignTokens.Clone
- Method VisualDesignTokens.Dark
- Method VisualDesignTokens.FromJson
- Method VisualDesignTokens.FromJsonFile
- Method VisualDesignTokens.GraphiteDark
- Method VisualDesignTokens.GraphiteLight
- Method VisualThemeBuilder.Colors
- Property VisualThemeBuilder.Dark
- Property VisualThemeBuilder.Light
Accepted by parameters 4
- Method Chart.WithDesignTokens
- Method VisualDesignTokens.CopyFrom
- Constructor VisualTheme.VisualTheme
- Constructor VisualTheme.VisualTheme
Constructors
public VisualDesignTokens() #Methods
public Void CopyFrom(VisualDesignTokens source) #VoidReplaces this editable palette with an independent copy of another palette.
Parameters
- source ChartForgeX.Themes.VisualDesignTokens
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 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 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. Used for numeric heatmap scales; null keeps the default blend.
public VisualDivergingRamp? DivergingRamp { get; set; } #Gets or sets the optional diverging ramp for values around a midpoint (see VisualDivergingRamp.ToColorScale).
public ChartColor? PlotBorder { get; set; } #Gets or sets the independent plot border; null uses the shared border.
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.