GripGradient

GradientReferences
[IoId("00000000-078F-4D74-9913-1149129256C2")] public sealed class GripGradient : Gradient, IEquatable<GripGradient>
A one dimensional colour gradient based on positional grips.

Constructors

GripGradient

#
Deserialization constructor.
public GripGradient(
reader
Reader to deserialize from.
)

GripGradient

#
Create a new gradient from parameters and colours.
public GripGradient(
Progression
progression,
Interpolation for this gradient.
space,
Colour space for gradient.
parameters,
Grip parameters.
IEnumerable<Color>
colours
Grip colours.
)

GripGradient

#
Create a new gradient from grips.
public GripGradient(
Progression
progression,
Interpolation for this gradient.
space,
Colour space for gradient.
params GradientGrip[]
grips
Grips for this gradient.
)

Properties

ApparentDomain

Gets the domain based on the Gradient.Mapping of this gradient. Note that this domain may be decreasing.
public (double lower, double upper) ApparentDomain { get; }
inherited fromGradient

GripCount

#
Gets the number of grips in this gradient.
public int GripCount { get; }

Interaction

#
Gets a user interaction object based on this gradient. Not all gradient types will have interaction objects.
public override GripGradientInteraction Interaction { get; }

IntrinsicDomain

#
Gets the interval containing the defined interior of this gradient. Note that this refers to the mathematics underlying the gradient, the Gradient.ApparentDomain encodes the publicly facing domain of this gradient.
public override (double lower, double upper) IntrinsicDomain { get; }

Mapping

Gets the mapping from sampling space to gradient space.
public GradientMapping Mapping { get; }
inherited fromGradient

Progression

#
Interpolation to use for this gradient.
public Progression Progression { get; }

Space

#
Gets the colour space this gradient is defined in.
public Space3 Space { get; }

Indexers

this[]

#
Gets the grip with the specified id.
public GradientGrip this[
id
Id to search for.
] { get; }
Grip with specified id or null.

this[]

#
Gets the grip at the specified index.
public GradientGrip this[
index
Index of grip to retrieve.
] { get; }

Methods

ColourAt

Gets the exact colour at the given parameter.
public bool ColourAt(
parameter,
Evaluation parameter.
out Colour
colour
Colour result.
)
inherited fromGradient
True if the parameter is a valid one.

ColourAt

Gets the colour at the given parameter.
public Color ColourAt(
parameter
Evaluation parameter.
)
inherited fromGradient
True if the parameter is a valid one.

ColourAtInternal

#
Sample the gradient at the given gradient parameter.
protected override Colour ColourAtInternal(
gradientParameter
Parameter.
)
Colour at parameter or null if gradient is undefined.

CreateTextureCache

Create a texture cache object for displaying this texture in the UI. The width of the texture bitmap ought to be decided by the callee.
protected virtual Gradient.GradientTexture CreateTextureCache()
inherited fromGradient

Draw

#
Draw this gradient as a horizontal progression. This method is optimized for speed and may not necessarily yield the exact result.
public override void Draw(
Graphics
graphics,
Graphics object to draw with.
RectangleF
rectangle,
Rectangle to fill.
parameter0,
parameter1
)
Gradient.Draw

Draw

Draw this gradient as a horizontal progression. This method is optimized for speed and may not necessarily yield the exact result.
public void Draw(
Graphics
graphics,
Graphics object to draw with.
RectangleF
rectangle
Rectangle to fill.
)
inherited fromGradient

Equals

#
public bool Equals()

Equals

#
public override bool Equals(
obj
)
Object.Equals

EqualsMapped

#
public bool EqualsMapped()

GetHashCode

#
public override int GetHashCode()

InsertGrip

#
Insert a grip at a specific parameter.
public GripGradient InsertGrip(
parameter
Parameter at which to insert the grip.
)
New gradient with inserted grip.

InsertGrip

#
Insert a grip into the gradient.
public GripGradient InsertGrip()

Interpolators

#
Gets the interpolation functions (3 colour channels and 1 alpha channel).
public Function[] Interpolators()

IsConstant

Tests whether this gradient has a zero-length domain and whether the colours on either side are identical.
public bool IsConstant(
out Colour
colour
Colour inside domain.
)
inherited fromGradient
True if gradient only has a single colour.

NormaliseMapping

#
Adjust the grips so that the IntrinsicDomain matches the Gradient.ApparentDomain and the Gradient.Mapping becomes identity.
public GripGradient NormaliseMapping()

Remap

Create a new gradient which is similar to this gradient but remapped to a different interval.
public Gradient Remap(
t0,
New gradient lower limit.
t1
New gradient upper limit.
)
inherited fromGradient
Mapped gradient.

Remap

#
Create a new gradient which is similar to this gradient but remapped to a different interval.
public override Gradient Remap()
Mapped gradient.
Gradient.Remap

RemapAutomatic

Remap this gradient to a new domain if the mapping has automatic lower or upper bounds.
public Gradient RemapAutomatic(
lower,
upper
)
inherited fromGradient

RemoveGrip

#
Remove the grip at the given index.
public GripGradient RemoveGrip(
index
Index of grip to remove.
)
New gradient with removed grip.

ReplaceGrip

#
Create a new gradient by replacing a grip.
public GripGradient ReplaceGrip(
index,
Index of grip to replace.
newGrip
New grip.
)
Gradient with updated grip.

Store

#
This method is called whenever the instance is required to serialize itself.
public override void Store(
writer
Writer object to serialize with.
)
Gradient.Store

SurroundingGrips

#
Gets the grips on either side of a parameter.
public void SurroundingGrips(
parameter,
Parameter.
left,
Grip to the left of or exactly at the parameter.
right
Grip to the right of the parameter.
)

ToBitmap

Render this gradient to a bitmap using exact per-pixel colours.
public Bitmap ToBitmap(
width,
Bitmap width.
height,
Bitmap height.
lower,
Gradient parameter at left edge of bitmap.
upper
Gradient parameter at right edge of bitmap.
)
inherited fromGradient
Bitmap.

ToBitmap

Render this gradient to a bitmap.
public Bitmap ToBitmap(
width,
Bitmap width.
height
Bitmap height.
)
inherited fromGradient
Bitmap.

ToGripArray

#
Create a duplicate of the internal grip array.
public GradientGrip[] ToGripArray()
Grip array.

ToString

#
Returns a string that represents the current object.
public override string ToString()
A string that represents the current object.
Object.ToString

WithAutomaticLimits

Adjust the automatic bounds flags for this gradient.
public Gradient WithAutomaticLimits(
autoLower = true,
autoUpper = true
)
inherited fromGradient

WithContinuousGrips

#
Convert all discontinuous grips into continuous grips.
public GripGradient WithContinuousGrips()
Modified gradient.

WithInterpolation

#
Change the interpolation on this gradient.
public GripGradient WithInterpolation(
Progression
interpolation
New interpolation.
)
Adjusted gradient.

WithSpace

#
Change the colour space on this gradient.
public GripGradient WithSpace(
space
New space.
)
Adjusted gradient.