[IoId("00000000-078F-4D74-9913-1149129256C2")]
public sealed class GripGradient : Gradient, IEquatable<GripGradient>
A one dimensional colour gradient based on positional grips.
Constructors
GripGradient
#public GripGradient(Progression progression, Space3 space, IEnumerable<double> parameters, IEnumerable<Color> colours)
Create a new gradient from parameters and colours.
Parameters:
| progression (Progression) | Interpolation for this gradient. |
| space (Space3) | Colour space for gradient. |
| parameters (IEnumerable<double>) | Grip parameters. |
| colours (IEnumerable<Color>) | Grip colours. |
GripGradient
#Create a new gradient from grips.
Parameters:
| progression (Progression) | Interpolation for this gradient. |
| space (Space3) | Colour space for gradient. |
| grips (params GradientGrip[]) | Grips for this gradient. |
Properties
ApparentDomain
Gets the domain based on the Gradient.Mapping of this gradient. Note that this domain may be decreasing.
Interaction
#Gets a user interaction object based on this gradient. Not all gradient types will have interaction objects.
Overrides: Gradient.Interaction
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.
Overrides: Gradient.IntrinsicDomain
Mapping
Gets the mapping from sampling space to gradient space.
Indexers
Methods
ColourAt
Gets the exact colour at the given parameter.
Parameters:
| parameter (double) | Evaluation parameter. |
Returns: True if the parameter is a valid one.
ColourAtInternal
#Sample the gradient at the given gradient parameter.
Parameters:
| gradientParameter (double) | Parameter. |
Returns: Colour at parameter or null if gradient is undefined.
Overrides: Gradient.ColourAtInternal
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.
Draw
#Draw this gradient as a horizontal progression. This method is optimized for speed and may not necessarily yield the exact result.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| rectangle (RectangleF) | Rectangle to fill. |
| parameter0 (double) | |
| parameter1 (double) |
Overrides: Gradient.Draw
Draw
public void Draw(Graphics graphics, RectangleF rectangle)
Draw this gradient as a horizontal progression. This method is optimized for speed and may not necessarily yield the exact result.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| rectangle (RectangleF) | Rectangle to fill. |
InsertGrip
#Insert a grip at a specific parameter.
Parameters:
| parameter (double) | Parameter at which to insert the grip. |
Returns: New gradient with inserted grip.
IsConstant
Tests whether this gradient has a zero-length domain and whether the colours on either side are identical.
Parameters:
| colour (out Colour) | Colour inside domain. |
Returns: 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.
Remap
Create a new gradient which is similar to this gradient but remapped to a different interval.
RemapAutomatic
Remap this gradient to a new domain if the mapping has automatic lower or upper bounds.
RemoveGrip
#Remove the grip at the given index.
Parameters:
| index (int) | Index of grip to remove. |
Returns: New gradient with removed grip.
ReplaceGrip
#Create a new gradient by replacing a grip.
Parameters:
| index (int) | Index of grip to replace. |
| newGrip (GradientGrip) | New grip. |
Returns: Gradient with updated grip.
Store
#This method is called whenever the instance is required to serialize itself.
Parameters:
| writer (IWriter) | Writer object to serialize with. |
Overrides: Gradient.Store
SurroundingGrips
#Gets the grips on either side of a parameter.
Parameters:
| parameter (double) | Parameter. |
| left (out GradientGrip) | Grip to the left of or exactly at the parameter. |
| right (out GradientGrip) | Grip to the right of the parameter. |
ToBitmap
Render this gradient to a bitmap using exact per-pixel colours.
ToString
#Returns a string that represents the current object.
Returns: A string that represents the current object.
Overrides: Object.ToString
WithAutomaticLimits
Adjust the automatic bounds flags for this gradient.
WithContinuousGrips
#Convert all discontinuous grips into continuous grips.
Returns: Modified gradient.
WithInterpolation
#Change the interpolation on this gradient.
Parameters:
| interpolation (Progression) | New interpolation. |
Returns: Adjusted gradient.