Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeLinearGradient

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

Dependency-free linear gradient intent in normalized local coordinates. Coordinates use a top-left origin where 0,0 is the shape's top-left corner and 1,1 is its bottom-right corner. Importers may preserve finite user-space vectors that cross those bounds without weakening public constructor validation.

Inheritance

  • object
  • OfficeLinearGradient

Usage

Explore 12 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.

Accepted by parameters 3

Constructors

OfficeLinearGradient 2 overloads
public OfficeLinearGradient(double startX, double startY, double endX, double endY, OfficeGradientStop start, OfficeGradientStop end) #

Creates a two-stop linear gradient.

Parameters

startX double required
startY double required
endX double required
endY double required
start OfficeIMO.Drawing.OfficeGradientStop required
end OfficeIMO.Drawing.OfficeGradientStop required
public OfficeLinearGradient(double startX, double startY, double endX, double endY, IReadOnlyList<OfficeGradientStop> stops) #

Creates a linear gradient with two or more ordered stops.

Parameters

startX double required
startY double required
endX double required
endY double required
stops System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficeGradientStop> required

Methods

public OfficeLinearGradient Clone() #

Creates a detached copy.

public static OfficeLinearGradient DiagonalDown(OfficeColor startColor, OfficeColor endColor) #

Creates a diagonal top-left to bottom-right gradient.

Parameters

startColor OfficeIMO.OfficeColor required
endColor OfficeIMO.OfficeColor required
FromAngle 2 overloads
public static OfficeLinearGradient FromAngle(OfficeColor startColor, OfficeColor endColor, double degrees) #

Creates a two-stop gradient projected through the normalized drawing rectangle at the supplied angle.

Parameters

startColor OfficeIMO.OfficeColor required
Color at offset 0.
endColor OfficeIMO.OfficeColor required
Color at offset 1.
degrees double required
Clockwise angle in degrees where 0 is left-to-right in local coordinates.

Returns

OfficeLinearGradient A gradient with endpoints clamped to the normalized drawing rectangle.
public static OfficeLinearGradient FromAngle(IReadOnlyList<OfficeGradientStop> stops, double degrees) #

Creates a gradient with ordered stops projected through the normalized drawing rectangle at the supplied angle.

Parameters

stops System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficeGradientStop> required
Gradient stops. The first stop must be offset 0 and the last stop must be offset 1.
degrees double required
Clockwise angle in degrees where 0 is left-to-right in local coordinates.

Returns

OfficeLinearGradient A gradient with endpoints clamped to the normalized drawing rectangle.
public static OfficeLinearGradient FromTransformedAngle(IReadOnlyList<OfficeGradientStop> stops, double destinationDegrees, double localWidth, double localHeight, OfficeTransform localToDestination) #

Creates a local-coordinate gradient whose color-field normal follows the supplied angle after an affine shape transform.

Parameters

stops System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficeGradientStop> required
Gradient stops. The first stop must use offset 0 and the last stop offset 1.
destinationDegrees double required
Clockwise gradient angle in destination coordinates.
localWidth double required
Width of the shape's local coordinate box.
localHeight double required
Height of the shape's local coordinate box.
localToDestination OfficeIMO.Drawing.OfficeTransform required
Affine transform applied to the shape after its local gradient is evaluated.

Returns

OfficeLinearGradient A local normalized gradient that preserves the requested destination-space color-field direction.
public static OfficeLinearGradient Horizontal(OfficeColor startColor, OfficeColor endColor) #

Creates a horizontal left-to-right gradient.

Parameters

startColor OfficeIMO.OfficeColor required
endColor OfficeIMO.OfficeColor required
public static OfficeLinearGradient Vertical(OfficeColor startColor, OfficeColor endColor) #

Creates a vertical top-to-bottom gradient.

Parameters

startColor OfficeIMO.OfficeColor required
endColor OfficeIMO.OfficeColor required
public OfficeLinearGradient WithColorInterpolation(OfficeGradientColorInterpolation interpolation) #

Returns a detached gradient using the specified color interpolation space.

Parameters

interpolation OfficeIMO.Drawing.OfficeGradientColorInterpolation required

Properties

public double StartX { get; } #

Normalized start X coordinate.

public double StartY { get; } #

Normalized start Y coordinate.

public double EndX { get; } #

Normalized end X coordinate.

public double EndY { get; } #

Normalized end Y coordinate.

public OfficeGradientColorInterpolation ColorInterpolation { get; private set; } #

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

public IReadOnlyList<OfficeGradientStop> Stops { get; } #

Gradient stops in offset order.