# VisualDesignTokens

Builds product-neutral semantic color palettes. A VisualTheme snapshots these mutable values.

 Class  

`ChartForgeX.Themes`

**Namespace**

`ChartForgeX.Themes`

**Assembly**

`ChartForgeX`

**Source**

[VisualDesignTokens.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L11)

**Modifiers**

sealed

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](/api/chartforgex-themes-visualdesigntokens/#method-clone)
- Method [VisualDesignTokens.Dark](/api/chartforgex-themes-visualdesigntokens/#method-dark)
- Method [VisualDesignTokens.FromJson](/api/chartforgex-themes-visualdesigntokens/#method-fromjson-string-chartforgex-thememode)
- Method [VisualDesignTokens.FromJsonFile](/api/chartforgex-themes-visualdesigntokens/#method-fromjsonfile-string-chartforgex-thememode)
- Method [VisualDesignTokens.GraphiteDark](/api/chartforgex-themes-visualdesigntokens/#method-graphitedark)
- Method [VisualDesignTokens.GraphiteLight](/api/chartforgex-themes-visualdesigntokens/#method-graphitelight)
- Method [VisualThemeBuilder.Colors](/api/chartforgex-themes-visualthemebuilder/#method-colors-chartforgex-thememode)
- Property [VisualThemeBuilder.Dark](/api/chartforgex-themes-visualthemebuilder/#property-dark)
- Property [VisualThemeBuilder.Light](/api/chartforgex-themes-visualthemebuilder/#property-light)

### Accepted by parameters 4

- Method [Chart.DesignTokens](/api/chartforgex-core-chart/#method-designtokens-chartforgex-themes-visualdesigntokens) parameter `tokens`
- Method [VisualDesignTokens.CopyFrom](/api/chartforgex-themes-visualdesigntokens/#method-copyfrom-chartforgex-themes-visualdesigntokens) parameter `source`
- Constructor [VisualTheme.VisualTheme](/api/chartforgex-themes-visualtheme/#constructor-ctor-chartforgex-themes-visualdesigntokens-chartforgex-themes-visualdesigntokens-chartforgex-themes-visualtypography-double-double-double-double-double-double-double-double-double-nullable-chartforgex-primitives-chartcolor-double-double-double) parameter `dark`
- Constructor [VisualTheme.VisualTheme](/api/chartforgex-themes-visualtheme/#constructor-ctor-chartforgex-themes-visualdesigntokens-chartforgex-themes-visualdesigntokens-chartforgex-themes-visualtypography-double-double-double-double-double-double-double-double-double-nullable-chartforgex-primitives-chartcolor-double-double-double) parameter `light`

 Filter members   

    Show inherited   

 

## Constructors

 `public VisualDesignTokens()` [#](#constructor-ctor) 

[VisualDesignTokens.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L11)

## Methods

 `public VisualDesignTokens Clone()` [#](#method-clone) 

[VisualDesignTokens.cs:99](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L99)

Creates an independent copy.

Returns

 `VisualDesignTokens` 

 `public void CopyFrom(VisualDesignTokens source)` [#](#method-copyfrom-chartforgex-themes-visualdesigntokens) 

[VisualDesignTokens.cs:83](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L83)

Replaces this editable palette with an independent copy of another palette.

Parameters

**source ChartForgeX.Themes.VisualDesignTokens required**

 `public static VisualDesignTokens Dark()` [#](#method-dark) 

[VisualDesignTokens.cs:124](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L124)

Creates a dark token set suitable for reports, dashboards, and wallpapers.

Returns

 `VisualDesignTokens` 

 `public static VisualDesignTokens FromJson(string json, ThemeMode mode = Light)` [#](#method-fromjson-string-chartforgex-thememode) 

[VisualDesignTokens.Json.cs:40](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Json.cs#L40)

Loads 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 string required**

The token document.

**mode ChartForgeX.ThemeMode = Light optional**

Which variant to load.

Returns

 `VisualDesignTokens` 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, ThemeMode mode = Light)` [#](#method-fromjsonfile-string-chartforgex-thememode) 

[VisualDesignTokens.Json.cs:111](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Json.cs#L111)

Loads tokens from a generated design-token JSON file.

Parameters

**path string required**

The token file path.

**mode ChartForgeX.ThemeMode = Light optional**

Which variant to load.

Returns

 `VisualDesignTokens` 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()` [#](#method-graphitedark) 

[VisualDesignTokens.Graphite.cs:34](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L34)

Creates the lifted Graphite dark colour roles and ramps.

Returns

 `VisualDesignTokens` 

 `public static VisualDesignTokens GraphiteLight()` [#](#method-graphitelight) 

[VisualDesignTokens.Graphite.cs:32](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L32)

Creates the approved Graphite light colour roles and ramps.

Returns

 `VisualDesignTokens` 

 `public ChartColorScale? ToSequentialColorScale()` [#](#method-tosequentialcolorscale) 

[VisualDesignTokens.cs:79](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L79)

Returns a sequential numeric color scale with every ramp color, weakest to strongest, or null without a ramp.

Returns

 `ChartColorScale?` 

 `public SvgColorVariables ToSvgColorVariables(Func<string, string?>? variableName = null)` [#](#method-tosvgcolorvariables-func-system-string-system-string) 

[VisualDesignTokens.SvgColors.cs:32](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.SvgColors.cs#L32)

Creates 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](/api/chartforgex-themes-svgcolorrole/) for surface.*, Text, Series, Status for severity, outcome, and state, SequentialRamp or DivergingRamp; 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<string, string?>? = null optional**

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

 `SvgColorVariables` 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 bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Properties

 `public VisualChromeTokens? Chrome { get; set; }` [#](#property-chrome) 

[VisualDesignTokens.cs:16](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L16)

Gets or sets optional tooltip and focus roles; null derives them from this palette.

 `public ChartColor Background { get; set; }` [#](#property-background) 

[VisualDesignTokens.cs:19](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L19)

Gets or sets the page or canvas background color.

 `public ChartColor Surface { get; set; }` [#](#property-surface) 

[VisualDesignTokens.cs:21](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L21)

Gets or sets the recessed surface color.

 `public ChartColor ElevatedSurface { get; set; }` [#](#property-elevatedsurface) 

[VisualDesignTokens.cs:23](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L23)

Gets or sets the elevated card surface color.

 `public ChartColor Foreground { get; set; }` [#](#property-foreground) 

[VisualDesignTokens.cs:25](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L25)

Gets or sets the primary foreground color.

 `public ChartColor MutedForeground { get; set; }` [#](#property-mutedforeground) 

[VisualDesignTokens.cs:27](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L27)

Gets or sets the secondary foreground color.

 `public ChartColor Border { get; set; }` [#](#property-border) 

[VisualDesignTokens.cs:29](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L29)

Gets or sets the guide and border color.

 `public ChartColor Accent { get; set; }` [#](#property-accent) 

[VisualDesignTokens.cs:31](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L31)

Gets or sets the primary accent color.

 `public ChartColor SecondaryAccent { get; set; }` [#](#property-secondaryaccent) 

[VisualDesignTokens.cs:33](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L33)

Gets or sets the secondary accent color.

 `public ChartColor Positive { get; set; }` [#](#property-positive) 

[VisualDesignTokens.cs:35](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L35)

Gets or sets the positive semantic color.

 `public ChartColor Warning { get; set; }` [#](#property-warning) 

[VisualDesignTokens.cs:37](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L37)

Gets or sets the warning semantic color.

 `public ChartColor Negative { get; set; }` [#](#property-negative) 

[VisualDesignTokens.cs:39](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L39)

Gets or sets the negative semantic color.

 `public ChartColor Disabled { get; set; }` [#](#property-disabled) 

[VisualDesignTokens.cs:41](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L41)

Gets or sets the disabled semantic color.

 `public ChartColor[] Palette { get; set; }` [#](#property-palette) 

[VisualDesignTokens.cs:45](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L45)

Gets or sets the qualitative data palette.

 `public VisualStatusTokens Status { get; set; }` [#](#property-status) 

[VisualDesignTokens.cs:59](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L59)

Gets or sets the severity, outcome, and operational-state colours. Use [VisualStatusTokens.OperationalStateCategories](/api/chartforgex-themes-visualstatustokens/) and related methods with [Chart.StateCategories](/api/chartforgex-core-chart/).

 `public ChartColor[]? SequentialRamp { get; set; }` [#](#property-sequentialramp) 

[VisualDesignTokens.cs:67](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L67)

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; }` [#](#property-divergingramp) 

[VisualDesignTokens.cs:75](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.cs#L75)

Gets or sets the optional diverging ramp for values around a midpoint (see [VisualDivergingRamp.ToColorScale](/api/chartforgex-themes-visualdivergingramp/)).

 `public ChartColor? Other { get; set; }` [#](#property-other) 

[VisualDesignTokens.Graphite.cs:8](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L8)

Gets or sets the neutral aggregate fill for Other, independently of operational status and empty tracks.

 `public ChartColor? PlotBorder { get; set; }` [#](#property-plotborder) 

[VisualDesignTokens.Graphite.cs:11](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L11)

Gets or sets the independent plot border; null uses the shared border.

 `public ChartColor? Muted { get; set; }` [#](#property-muted) 

[VisualDesignTokens.Graphite.cs:13](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L13)

Gets or sets muted annotation text; null retains the secondary foreground mapping.

 `public ChartColor? Grid { get; set; }` [#](#property-grid) 

[VisualDesignTokens.Graphite.cs:15](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L15)

Gets or sets horizontal plot guides; null retains the border-derived mapping.

 `public ChartColor? Axis { get; set; }` [#](#property-axis) 

[VisualDesignTokens.Graphite.cs:17](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L17)

Gets or sets the zero baseline; null retains the secondary-text-derived mapping.

 `public ChartColor? Info { get; set; }` [#](#property-info) 

[VisualDesignTokens.Graphite.cs:19](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L19)

Gets or sets the informational state colour.

 `public ChartColor? Quiet { get; set; }` [#](#property-quiet) 

[VisualDesignTokens.Graphite.cs:21](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L21)

Gets or sets a quiet healthy fill.

 `public ChartColor? QuietLine { get; set; }` [#](#property-quietline) 

[VisualDesignTokens.Graphite.cs:23](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L23)

Gets or sets an understated healthy line.

 `public ChartColor? Neutral { get; set; }` [#](#property-neutral) 

[VisualDesignTokens.Graphite.cs:25](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L25)

Gets or sets the neutral aggregate fill.

 `public ChartColor? Neutral2 { get; set; }` [#](#property-neutral2) 

[VisualDesignTokens.Graphite.cs:27](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L27)

Gets or sets the neutral track fill.

 `public ChartColor? Neutral3 { get; set; }` [#](#property-neutral3) 

[VisualDesignTokens.Graphite.cs:29](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDesignTokens.Graphite.cs#L29)

Gets or sets the neutral zero-cell fill.

<!-- PowerForge markdown artifact sha256:442CC9B576669C9346432D0C592CC1590A80942F6B1827484DA4627BC8083AA2 -->
