# SvgColorVariables

Maps colours to CSS custom properties so SVG output can follow a host's design tokens: every paint value (fill, stroke, stop-color, flood-color…

 Class  

`ChartForgeX.Themes`

**Namespace**

`ChartForgeX.Themes`

**Assembly**

`ChartForgeX`

**Source**

[SvgColorVariables.cs:56](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.cs#L56)

**Modifiers**

sealed

Maps colours to CSS custom properties so SVG output can follow a host's design tokens: every paint value (fill, stroke, stop-color, flood-color, lighting-color, color, in attributes, style attributes, and <style> elements) whose colour is mapped is written as var(--name, #rrggbb), with the literal colour as the fallback, so the SVG looks the same where the property is not defined. A paint more transparent than its variable is written as color-mix(in srgb, var(--name, #rrggbb) N%, transparent). PNG output is not affected.

## Inheritance

- object
- SvgColorVariables

## Remarks

Set on a chart, grid, or topology (Chart.WithSvgColorVariables, ChartGrid.WithSvgColorVariables, TopologyRenderOptions.SvgColorVariables), the renderers write colours by role. A colour the renderer derives (the white sheen of a line, the highlight of a surface, the contrast stroke of a topology icon) stays literal even when it equals a token colour. A blend of token colours (bar gradients, heatmap and calendar ramp steps, neutral zero and empty days, topology tints) is written as color-mix(in srgb, …) of their properties, so it follows a theme switch. A colour written for a role (a series, a status, a ramp step, the surface behind marks) takes the variable of that role when several share its colour. Text on filled marks (heatmap and hexbin values, categorical cell text, Gantt lane labels) is written as the text colour or, on strong marks, the surface behind the marks, by role. Other paints match by colour value. on finished markup only matches by colour value (red, green, and blue; a paint is only matched when it is no more opaque than the variable): every paint of a mapped colour takes the variable, including derived colours that happen to equal it. When two variables share a colour, the one added first is used, and variables are not used for text fills. Do not apply variables to SVG rendered with variables: its derived colours are literal on purpose and would be mapped by value. Roles tell token kinds apart (a series colour from a ramp step of the same value), not tokens within a kind: when two surface tokens share a colour in one theme, the one added first names it.

## Usage

 Explore 66 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 11

- Property [ChartGrid.SvgColorVariables](/api/chartforgex-core-chartgrid/#property-svgcolorvariables)
- Property [ChartOptions.SvgColorVariables](/api/chartforgex-core-chartoptions/#property-svgcolorvariables)
- Property [VisualSvgOptions.ColorVariables](/api/chartforgex-rendering-visualsvgoptions/#property-colorvariables)
- Method [SvgColorVariables.Add](/api/chartforgex-themes-svgcolorvariables/#method-add-string-chartforgex-primitives-chartcolor-chartforgex-themes-svgcolorrole)
- Method [SvgColorVariables.AddInk](/api/chartforgex-themes-svgcolorvariables/#method-addink-string-chartforgex-primitives-chartcolor-chartforgex-primitives-chartcolor-chartforgex-themes-svgcolorrole)
- Method [SvgColorVariables.AddThemeToken](/api/chartforgex-themes-svgcolorvariables/#method-addthemetoken-chartforgex-themes-visualthemecolortoken-string)
- Method [SvgColorVariables.Clone](/api/chartforgex-themes-svgcolorvariables/#method-clone)
- Method [SvgColorVariables.SharedRoles](/api/chartforgex-themes-svgcolorvariables/#method-sharedroles-chartforgex-themes-visualtheme-chartforgex-thememode)
- Method [VisualDesignTokens.ToSvgColorVariables](/api/chartforgex-themes-visualdesigntokens/#method-tosvgcolorvariables-func-system-string-system-string)
- Property [TopologyRenderOptions.SvgColorVariables](/api/chartforgex-topology-topologyrenderoptions/#property-svgcolorvariables)
- Property [VisualBlockOptions.SvgColorVariables](/api/chartforgex-visualblocks-visualblockoptions/#property-svgcolorvariables)

### Accepted by parameters 55

- Extension method [Chart.SvgColorVariables](/api/chartforgex-core-chart/#extension-svgcolorvariables-chartforgex-core-chart-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [ChartFluent.SvgColorVariables](/api/chartforgex-core-chartfluent/#method-svgcolorvariables-chartforgex-core-chart-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [ChartGrid.SvgColorVariables](/api/chartforgex-core-chartgrid/#extension-svgcolorvariables-chartforgex-core-chartgrid-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [ChartGridFluent.SvgColorVariables](/api/chartforgex-core-chartgridfluent/#method-svgcolorvariables-chartforgex-core-chartgrid-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [ChartOptions.SvgColorVariables](/api/chartforgex-core-chartoptions/#extension-svgcolorvariables-chartforgex-core-chartoptions-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [ChartOptionsFluent.SvgColorVariables](/api/chartforgex-core-chartoptionsfluent/#method-svgcolorvariables-chartforgex-core-chartoptions-chartforgex-themes-svgcolorvariables) parameter `value`
- Constructor [VisualSvgOptions.VisualSvgOptions](/api/chartforgex-rendering-visualsvgoptions/#constructor-ctor-string-chartforgex-themes-svgcolorvariables-chartforgex-rendering-visualsvglinktarget-boolean-chartforgex-rendering-visualsvgeffectprofile-chartforgex-rendering-visualrenderoptions) parameter `colorVariables`
- Extension method [TopologyRenderOptions.SvgColorVariables](/api/chartforgex-topology-topologyrenderoptions/#extension-svgcolorvariables-chartforgex-topology-topologyrenderoptions-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [TopologyRenderOptionsFluent.SvgColorVariables](/api/chartforgex-topology-topologyrenderoptionsfluent/#method-svgcolorvariables-chartforgex-topology-topologyrenderoptions-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [ActivityTimelineBlock.SvgColorVariables](/api/chartforgex-visualblocks-activitytimelineblock/#extension-svgcolorvariables-chartforgex-visualblocks-activitytimelineblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [ActivityTimelineBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-activitytimelineblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-activitytimelineblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [BlockLayoutBlock.SvgColorVariables](/api/chartforgex-visualblocks-blocklayoutblock/#extension-svgcolorvariables-chartforgex-visualblocks-blocklayoutblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [BlockLayoutBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-blocklayoutblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-blocklayoutblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [ChartList.SvgColorVariables](/api/chartforgex-visualblocks-chartlist/#extension-svgcolorvariables-chartforgex-visualblocks-chartlist-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [ChartListFluent.SvgColorVariables](/api/chartforgex-visualblocks-chartlistfluent/#method-svgcolorvariables-chartforgex-visualblocks-chartlist-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [ChartTable.SvgColorVariables](/api/chartforgex-visualblocks-charttable/#extension-svgcolorvariables-chartforgex-visualblocks-charttable-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [ChartTableFluent.SvgColorVariables](/api/chartforgex-visualblocks-charttablefluent/#method-svgcolorvariables-chartforgex-visualblocks-charttable-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [DateStripBlock.SvgColorVariables](/api/chartforgex-visualblocks-datestripblock/#extension-svgcolorvariables-chartforgex-visualblocks-datestripblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [DateStripBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-datestripblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-datestripblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [EntityStripBlock.SvgColorVariables](/api/chartforgex-visualblocks-entitystripblock/#extension-svgcolorvariables-chartforgex-visualblocks-entitystripblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [EntityStripBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-entitystripblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-entitystripblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [FishboneDiagramBlock.SvgColorVariables](/api/chartforgex-visualblocks-fishbonediagramblock/#extension-svgcolorvariables-chartforgex-visualblocks-fishbonediagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [FishboneDiagramBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-fishbonediagramblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-fishbonediagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [GitGraphBlock.SvgColorVariables](/api/chartforgex-visualblocks-gitgraphblock/#extension-svgcolorvariables-chartforgex-visualblocks-gitgraphblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [GitGraphBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-gitgraphblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-gitgraphblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [HeatmapInsightCard.SvgColorVariables](/api/chartforgex-visualblocks-heatmapinsightcard/#extension-svgcolorvariables-chartforgex-visualblocks-heatmapinsightcard-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [HeatmapInsightCardFluent.SvgColorVariables](/api/chartforgex-visualblocks-heatmapinsightcardfluent/#method-svgcolorvariables-chartforgex-visualblocks-heatmapinsightcard-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [JourneyDiagramBlock.SvgColorVariables](/api/chartforgex-visualblocks-journeydiagramblock/#extension-svgcolorvariables-chartforgex-visualblocks-journeydiagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [JourneyDiagramBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-journeydiagramblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-journeydiagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [MetricCard.SvgColorVariables](/api/chartforgex-visualblocks-metriccard/#extension-svgcolorvariables-chartforgex-visualblocks-metriccard-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [MetricCardFluent.SvgColorVariables](/api/chartforgex-visualblocks-metriccardfluent/#method-svgcolorvariables-chartforgex-visualblocks-metriccard-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [PacketLayoutBlock.SvgColorVariables](/api/chartforgex-visualblocks-packetlayoutblock/#extension-svgcolorvariables-chartforgex-visualblocks-packetlayoutblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [PacketLayoutBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-packetlayoutblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-packetlayoutblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [RadialMetricCard.SvgColorVariables](/api/chartforgex-visualblocks-radialmetriccard/#extension-svgcolorvariables-chartforgex-visualblocks-radialmetriccard-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [RadialMetricCardFluent.SvgColorVariables](/api/chartforgex-visualblocks-radialmetriccardfluent/#method-svgcolorvariables-chartforgex-visualblocks-radialmetriccard-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [RailroadDiagramBlock.SvgColorVariables](/api/chartforgex-visualblocks-railroaddiagramblock/#extension-svgcolorvariables-chartforgex-visualblocks-railroaddiagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [RailroadDiagramBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-railroaddiagramblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-railroaddiagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [ScheduleTimelineBlock.SvgColorVariables](/api/chartforgex-visualblocks-scheduletimelineblock/#extension-svgcolorvariables-chartforgex-visualblocks-scheduletimelineblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [ScheduleTimelineBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-scheduletimelineblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-scheduletimelineblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [SectionHeaderBlock.SvgColorVariables](/api/chartforgex-visualblocks-sectionheaderblock/#extension-svgcolorvariables-chartforgex-visualblocks-sectionheaderblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [SectionHeaderBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-sectionheaderblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-sectionheaderblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [SegmentedMetricBlock.SvgColorVariables](/api/chartforgex-visualblocks-segmentedmetricblock/#extension-svgcolorvariables-chartforgex-visualblocks-segmentedmetricblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [SegmentedMetricBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-segmentedmetricblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-segmentedmetricblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [TimelineDiagramBlock.SvgColorVariables](/api/chartforgex-visualblocks-timelinediagramblock/#extension-svgcolorvariables-chartforgex-visualblocks-timelinediagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [TimelineDiagramBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-timelinediagramblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-timelinediagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [TreeViewBlock.SvgColorVariables](/api/chartforgex-visualblocks-treeviewblock/#extension-svgcolorvariables-chartforgex-visualblocks-treeviewblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [TreeViewBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-treeviewblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-treeviewblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [VennDiagramBlock.SvgColorVariables](/api/chartforgex-visualblocks-venndiagramblock/#extension-svgcolorvariables-chartforgex-visualblocks-venndiagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [VennDiagramBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-venndiagramblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-venndiagramblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [VisualBlockOptions.SvgColorVariables](/api/chartforgex-visualblocks-visualblockoptions/#extension-svgcolorvariables-chartforgex-visualblocks-visualblockoptions-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [VisualBlockOptionsFluent.SvgColorVariables](/api/chartforgex-visualblocks-visualblockoptionsfluent/#method-svgcolorvariables-chartforgex-visualblocks-visualblockoptions-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [WardleyMapBlock.SvgColorVariables](/api/chartforgex-visualblocks-wardleymapblock/#extension-svgcolorvariables-chartforgex-visualblocks-wardleymapblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [WardleyMapBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-wardleymapblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-wardleymapblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Extension method [WorkloadListBlock.SvgColorVariables](/api/chartforgex-visualblocks-workloadlistblock/#extension-svgcolorvariables-chartforgex-visualblocks-workloadlistblock-chartforgex-themes-svgcolorvariables) parameter `value`
- Method [WorkloadListBlockFluent.SvgColorVariables](/api/chartforgex-visualblocks-workloadlistblockfluent/#method-svgcolorvariables-chartforgex-visualblocks-workloadlistblock-chartforgex-themes-svgcolorvariables) parameter `value`

 Filter members   

    Show inherited   

 

## Constructors

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

[SvgColorVariables.cs:56](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.cs#L56)

## Methods

 `public SvgColorVariables Add(string name, ChartColor color, SvgColorRole role = Any)` [#](#method-add-string-chartforgex-primitives-chartcolor-chartforgex-themes-svgcolorrole) 

[SvgColorVariables.cs:77](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.cs#L77)

Adds a variable. When a variable for the same colour was added before, that one keeps the colour for paints without a role and this one is only used by paints of its own role.

Parameters

**name string required**

The custom property name, for example --brand-series-1.

**color ChartForgeX.Primitives.ChartColor required**

The colour it stands for; its literal value is the fallback.

**role ChartForgeX.Themes.SvgColorRole = Any optional**

The role of the colour; [SvgColorRole.Surface](/api/chartforgex-themes-svgcolorrole/) keeps text fills of this colour literal when they are matched by value.

Returns

 `SvgColorVariables` The same instance. 

Exceptions

- `ArgumentException` – The name is not -- followed by letters, digits, -, or _.
- `ArgumentOutOfRangeException` – The role is not defined.

 `public SvgColorVariables AddInk(string name, ChartColor fill, ChartColor ink, SvgColorRole fillRole)` [#](#method-addink-string-chartforgex-primitives-chartcolor-chartforgex-primitives-chartcolor-chartforgex-themes-svgcolorrole) 

[SvgColorVariables.cs:134](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.cs#L134)

Adds the contrasting text property paired with a filled mark. The renderer selects this property by the fill, so black or white text follows that mark when the host switches themes, without changing unrelated text.

Parameters

**name string required**

The CSS custom property for the ink, for example --cfx-series-1-ink.

**fill ChartForgeX.Primitives.ChartColor required**

The opaque mark colour in this theme.

**ink ChartForgeX.Primitives.ChartColor required**

The contrasting text colour in this theme.

**fillRole ChartForgeX.Themes.SvgColorRole required**

The role of the filled mark. [SvgColorRole.Ramp](/api/chartforgex-themes-svgcolorrole/) also overrides both theme-ramp families.

Returns

 `SvgColorVariables` The same instance. 

Exceptions

- `ArgumentException` – The property name is invalid.
- `ArgumentOutOfRangeException` – The role is not defined.

 `public SvgColorVariables AddThemeToken(VisualThemeColorToken token, string cssVariableName)` [#](#method-addthemetoken-chartforgex-themes-visualthemecolortoken-string) 

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

Binds a canonical theme color to a CSS custom property while preserving the token's identity.

Parameters

**token ChartForgeX.Themes.VisualThemeColorToken required**

The canonical theme color to bind.

**cssVariableName string required**

The CSS custom property name, for example --app-surface.

Returns

 `SvgColorVariables` The same instance. Adding the same token again replaces its previous binding. 

Exceptions

- `ArgumentOutOfRangeException` – The theme token is not defined.
- `ArgumentException` – The CSS custom property name is invalid.

 `public string Apply(string svg)` [#](#method-apply-string) 

[SvgColorVariables.cs:161](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.cs#L161)

Writes mapped paint values in finished svg as custom properties, by colour value. Applying it twice changes nothing more. Renderers given these variables also write derived colours by role (see remarks).

Parameters

**svg string required**

SVG markup, for example from ToSvg().

Returns

 `string` The markup with mapped paints replaced. 

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

[SvgColorVariables.cs:108](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.cs#L108)

Creates an independent copy.

Returns

 `SvgColorVariables` 

 `public IReadOnlyList<SvgColorVariable> GetVariablesForSvg(string svg)` [#](#method-getvariablesforsvg-string) 

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

Gets this theme's colour variables and the contrasting inks required by the supplied SVG.

Parameters

**svg string required**

An SVG exported with colour variables enabled.

Returns

 `IReadOnlyList<SvgColorVariable>` The base variables followed by the referenced derived ink variables, evaluated in this theme. 

 `public static string SharedRoleName(string tokenPath)` [#](#method-sharedrolename-string) 

[SvgColorVariables.SharedRoles.cs:22](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.SharedRoles.cs#L22)

Returns the shared design-role property CanopyX and HtmlForgeX pages define for a token path (see [VisualDesignTokens.ToSvgColorVariables](/api/chartforgex-themes-visualdesigntokens/)): ramps.* become --hfx-ramp-* and every other path --hfx-color-*, in kebab case. For example series.1 is --hfx-color-series-1, surface.card is --hfx-color-surface-card, surface.line is --hfx-color-surface-line, text.primary is --hfx-color-text-primary, text.secondary is --hfx-color-text-secondary, accent.base is --hfx-color-accent-base and ramps.sequential.1 is --hfx-ramp-sequential-1.

Parameters

**tokenPath string required**

A token path such as surface.cardAlt.

Returns

 `string` The custom property name. 

Exceptions

- `ArgumentException` – The path is empty or holds characters other than ASCII letters, digits and dots.

 `public static SvgColorVariables SharedRoles(VisualTheme? theme = null, ThemeMode mode = Light)` [#](#method-sharedroles-chartforgex-themes-visualtheme-chartforgex-thememode) 

[SvgColorVariables.SharedRoles.cs:46](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.SharedRoles.cs#L46)

Creates colour variables named after the shared --hfx-* design roles ([SvgColorVariables.SharedRoleName](/api/chartforgex-themes-svgcolorvariables/)), with the theme's colours as fallbacks: a chart on a CanopyX or HtmlForgeX page takes the page's theme, and a page that defines none of the properties shows the theme unchanged. Series paints keep their palette slot, so two slots with equal colours still write --hfx-color-series-n of their own slot.

Parameters

**theme ChartForgeX.Themes.VisualTheme? = null optional**

The theme the chart is prepared with; null uses [VisualTheme.Graphite](/api/chartforgex-themes-visualtheme/).

**mode ChartForgeX.ThemeMode = Light optional**

The mode the chart is prepared in.

Returns

 `SvgColorVariables` The colour variables, for Chart.WithSvgColorVariables, ChartGrid.WithSvgColorVariables or a VisualSvgOptions. 

## 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 IReadOnlyList<SvgColorVariable> Variables { get; }` [#](#property-variables) 

[SvgColorVariables.cs:64](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/SvgColorVariables.cs#L64)

Gets the variables in the order they were added.

## Fields

 `public const string SharedFontFamily` [#](#field-sharedfontfamily) 

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

The shared design-role property for the page's proportional font family.

Value: `--hfx-font-sans`

<!-- PowerForge markdown artifact sha256:7DA96C5B08E7BA1232498CF93B9108E9F9EFB744B4CF8F70F7FE961AB450F203 -->
