# OfficeRadialGradient

Dependency-free radial gradient intent in normalized local coordinates.

Class 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeRadialGradient.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L49)

**Modifiers**

sealed

Dependency-free radial gradient intent in normalized local coordinates. Coordinates use a top-left origin and are mapped through CoordinateTransform into normalized shape coordinates. With the identity transform, 0,0 is the shape's top-left corner and 1,1 is its bottom-right corner. Ellipse centers may sit outside that box to preserve authored gradients whose focal point is off-canvas. Pixels unreached by a physical circle remain transparent; native-format adapters may explicitly supply outside endpoint paint. Independent horizontal and vertical radii allow ellipses before the affine coordinate transform while the original circle constructors remain source-compatible.

## Inheritance

- object
- OfficeRadialGradient

## Usage

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

- Method [OfficeRadialGradient.Centered](/api/core/officeimo-drawing-officeradialgradient/#method-centered-officeimo-officecolor-officeimo-officecolor)
- Method [OfficeRadialGradient.Clone](/api/core/officeimo-drawing-officeradialgradient/#method-clone)
- Method [OfficeRadialGradient.TransformCoordinates](/api/core/officeimo-drawing-officeradialgradient/#method-transformcoordinates-officeimo-drawing-officetransform)
- Method [OfficeRadialGradient.WithColorInterpolation](/api/core/officeimo-drawing-officeradialgradient/#method-withcolorinterpolation-officeimo-drawing-officegradientcolorinterpolation)
- Method [OfficeRadialGradient.WithSpreadMode](/api/core/officeimo-drawing-officeradialgradient/#method-withspreadmode-officeimo-drawing-officegradientspreadmode)
- Property [OfficeShape.FillRadialGradient](/api/core/officeimo-drawing-officeshape/#property-fillradialgradient)
- Property [OfficeShape.StrokeRadialGradient](/api/core/officeimo-drawing-officeshape/#property-strokeradialgradient)

### Accepted by parameters 3

- Method [OfficeRasterCanvas.FillRadialGradientPolygon](/api/core/officeimo-drawing-officerastercanvas/#method-fillradialgradientpolygon-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-drawing-officeradialgradient) parameter `gradient`
- Method [OfficeRasterCanvas.FillRadialGradientRectangle](/api/core/officeimo-drawing-officerastercanvas/#method-fillradialgradientrectangle-double-double-double-double-officeimo-drawing-officeradialgradient) parameter `gradient`
- Method [OfficeSvgFormatting.AppendRadialGradientDefinition](/api/core/officeimo-drawing-officesvgformatting/#method-appendradialgradientdefinition-text-stringbuilder-string-officeimo-drawing-officeradialgradient) parameter `gradient`

Filter members 

Show inherited

## Constructors

OfficeRadialGradient 3 overloads

`public OfficeRadialGradient(double startX, double startY, double startRadius, double endX, double endY, double endRadius, OfficeGradientStop start, OfficeGradientStop end)` [#](#constructor-ctor-double-double-double-double-double-double-officeimo-drawing-officegradientstop-officeimo-drawing-officegradientstop)

[OfficeRadialGradient.Coordinates.cs:4](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.Coordinates.cs#L4)

Creates a radial gradient between two circles.

Parameters

**startX double required**

**startY double required**

**startRadius double required**

**endX double required**

**endY double required**

**endRadius double required**

**start OfficeIMO.Drawing.OfficeGradientStop required**

**end OfficeIMO.Drawing.OfficeGradientStop required**

`public OfficeRadialGradient(double startX, double startY, double startRadius, double endX, double endY, double endRadius, IReadOnlyList<OfficeGradientStop> stops)` [#](#constructor-ctor-double-double-double-double-double-double-collections-generic-ireadonlylist-officeimo-drawing-officegradientstop)

[OfficeRadialGradient.Coordinates.cs:4](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.Coordinates.cs#L4)

Creates a radial gradient between two circles with two or more ordered stops.

Parameters

**startX double required**

**startY double required**

**startRadius double required**

**endX double required**

**endY double required**

**endRadius double required**

**stops System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficeGradientStop> required**

`public OfficeRadialGradient(double startX, double startY, double startRadiusX, double startRadiusY, double endX, double endY, double endRadiusX, double endRadiusY, IReadOnlyList<OfficeGradientStop> stops)` [#](#constructor-ctor-double-double-double-double-double-double-double-double-collections-generic-ireadonlylist-officeimo-drawing-officegradientstop)

[OfficeRadialGradient.Coordinates.cs:4](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.Coordinates.cs#L4)

Creates a radial gradient between two axis-aligned ellipses with the same aspect ratio.

Parameters

**startX double required**

**startY double required**

**startRadiusX double required**

**startRadiusY double required**

**endX double required**

**endY double required**

**endRadiusX double required**

**endRadiusY double required**

**stops System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficeGradientStop> required**

## Methods

`public static OfficeRadialGradient Centered(OfficeColor startColor, OfficeColor endColor)` [#](#method-centered-officeimo-officecolor-officeimo-officecolor)

[OfficeRadialGradient.cs:116](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L116)

Creates a centered radial gradient from the center outward.

Parameters

**startColor OfficeIMO.OfficeColor required**

**endColor OfficeIMO.OfficeColor required**

Returns

`OfficeRadialGradient`

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

[OfficeRadialGradient.cs:119](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L119)

Creates a detached copy.

Returns

`OfficeRadialGradient`

`public OfficeRadialGradient TransformCoordinates(OfficeTransform transform)` [#](#method-transformcoordinates-officeimo-drawing-officetransform)

[OfficeRadialGradient.Coordinates.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.Coordinates.cs#L11)

Returns a gradient transformed in normalized shape coordinates, preserving its circular or elliptical field.

Parameters

**transform OfficeIMO.Drawing.OfficeTransform required**

Returns

`OfficeRadialGradient`

Exceptions

- `ArgumentException` – The combined transform cannot be inverted.

`public OfficeRadialGradient WithColorInterpolation(OfficeGradientColorInterpolation interpolation)` [#](#method-withcolorinterpolation-officeimo-drawing-officegradientcolorinterpolation)

[OfficeRadialGradient.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L49)

Returns a detached gradient using the specified color interpolation space.

Parameters

**interpolation OfficeIMO.Drawing.OfficeGradientColorInterpolation required**

Returns

`OfficeRadialGradient`

`public OfficeRadialGradient WithSpreadMode(OfficeGradientSpreadMode spreadMode)` [#](#method-withspreadmode-officeimo-drawing-officegradientspreadmode)

[OfficeRadialGradient.Spread.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.Spread.cs#L9)

Returns a detached gradient with the requested spread behavior.

Parameters

**spreadMode OfficeIMO.Drawing.OfficeGradientSpreadMode required**

Returns

`OfficeRadialGradient`

## 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 OfficeTransform CoordinateTransform { get; private set; }` [#](#property-coordinatetransform)

[OfficeRadialGradient.Coordinates.cs:6](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.Coordinates.cs#L6)

Affine mapping from gradient coordinates to normalized shape coordinates.

`public double StartX { get; }` [#](#property-startx)

[OfficeRadialGradient.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L15)

Start circle center X coordinate in gradient-coordinate units.

`public double StartY { get; }` [#](#property-starty)

[OfficeRadialGradient.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L18)

Start circle center Y coordinate in gradient-coordinate units.

`public double StartRadius { get; }` [#](#property-startradius)

[OfficeRadialGradient.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L21)

Start circle radius, or the horizontal radius for an elliptical definition.

`public double StartRadiusX { get; }` [#](#property-startradiusx)

[OfficeRadialGradient.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L24)

Horizontal start ellipse radius.

`public double StartRadiusY { get; }` [#](#property-startradiusy)

[OfficeRadialGradient.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L27)

Vertical start ellipse radius.

`public double EndX { get; }` [#](#property-endx)

[OfficeRadialGradient.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L30)

End circle center X coordinate in gradient-coordinate units.

`public double EndY { get; }` [#](#property-endy)

[OfficeRadialGradient.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L33)

End circle center Y coordinate in gradient-coordinate units.

`public double EndRadius { get; }` [#](#property-endradius)

[OfficeRadialGradient.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L36)

End circle radius, or the horizontal radius for an elliptical definition.

`public double EndRadiusX { get; }` [#](#property-endradiusx)

[OfficeRadialGradient.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L39)

Horizontal end ellipse radius.

`public double EndRadiusY { get; }` [#](#property-endradiusy)

[OfficeRadialGradient.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L42)

Vertical end ellipse radius.

`public OfficeGradientColorInterpolation ColorInterpolation { get; private set; }` [#](#property-colorinterpolation)

[OfficeRadialGradient.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L45)

Color space used to interpolate RGB channels between stops. Defaults to encoded sRGB.

`public IReadOnlyList<OfficeGradientStop> Stops { get; private set; }` [#](#property-stops)

[OfficeRadialGradient.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.cs#L55)

Gradient stops in offset order.

`public OfficeGradientSpreadMode SpreadMode { get; private set; }` [#](#property-spreadmode)

[OfficeRadialGradient.Spread.cs:5](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeRadialGradient.Spread.cs#L5)

Behavior beyond the stop interval. Defaults to endpoint padding.

<!-- PowerForge markdown artifact sha256:CF85CF09C040FE4AF99F205A99127A2525FDCE8FA2899D1C9D0C329EC7044A82 -->
