# VisualDivergingRamp

A diverging colour ramp for values around a meaningful midpoint: a negative arm, a neutral midpoint colour, and a positive arm.

 Class  

`ChartForgeX.Themes`

**Namespace**

`ChartForgeX.Themes`

**Assembly**

`ChartForgeX`

**Source**

[VisualDivergingRamp.cs:20](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDivergingRamp.cs#L20)

**Modifiers**

sealed

A diverging colour ramp for values around a meaningful midpoint: a negative arm, a neutral midpoint colour, and a positive arm. Each arm runs from the weakest to the strongest magnitude.

## Inheritance

- object
- VisualDivergingRamp

## Usage

 Explore 2 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 2

- Property [VisualDesignTokens.DivergingRamp](/api/chartforgex-themes-visualdesigntokens/#property-divergingramp)
- Property [VisualThemeColors.DivergingRamp](/api/chartforgex-themes-visualthemecolors/#property-divergingramp)

 Filter members   

    Show inherited   

 

## Constructors

 `public VisualDivergingRamp(IEnumerable<ChartColor> negative, ChartColor neutral, IEnumerable<ChartColor> positive)` [#](#constructor-ctor-collections-generic-ienumerable-chartforgex-primitives-chartcolor-chartforgex-primitives-chartcolor-collections-generic-ienumerable-chartforgex-primitives-chartcolor) 

[VisualDivergingRamp.cs:20](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDivergingRamp.cs#L20)

Initializes a diverging ramp.

Parameters

**negative System.Collections.Generic.IEnumerable<ChartForgeX.Primitives.ChartColor> required**

The negative arm, weakest to strongest; at least one colour.

**neutral ChartForgeX.Primitives.ChartColor required**

The midpoint colour.

**positive System.Collections.Generic.IEnumerable<ChartForgeX.Primitives.ChartColor> required**

The positive arm, weakest to strongest; at least one colour.

## Methods

 `public ChartColorScale ToColorScale(double? midpointValue = null)` [#](#method-tocolorscale-nullable-system-double) 

[VisualDivergingRamp.cs:43](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDivergingRamp.cs#L43)

Creates a numeric color scale with every step of the ramp: the negative arm from its strongest colour at the minimum to its weakest next to the midpoint, the neutral midpoint, and the positive arm from its weakest to its strongest colour at the maximum.

Parameters

**midpointValue double? = null optional**

The value drawn in the neutral colour; null uses the middle of the data range.

Returns

 `ChartColorScale` A diverging numeric color scale. 

## 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<ChartColor> Negative { get; }` [#](#property-negative) 

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

Gets the negative arm, weakest to strongest.

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

[VisualDivergingRamp.cs:30](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Themes/VisualDivergingRamp.cs#L30)

Gets the midpoint colour.

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

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

Gets the positive arm, weakest to strongest.

<!-- PowerForge markdown artifact sha256:8D49D6B48BE5F7E9BF862BD8773E09ED74624AF64934442229938C3765E094AA -->
