Gradient
ReferencesBase class for all Grasshopper gradients. Consider using GripGradient as a ready-made implementation.
Constructors
Properties
ApparentDomain
#Gets the domain based on the 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.
IntrinsicDomain
#Gets the interval containing the defined interior of this gradient. Note that this refers to the mathematics underlying the gradient, the ApparentDomain encodes the publicly facing domain of this gradient.
Methods
ColourAt
#Gets the exact colour at the given parameter.
Returns: True if the parameter is a valid one.
ColourAtInternal
#Sample the gradient at the given gradient parameter.
Returns: 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.
Draw
#Draw this gradient as a horizontal progression. This method is optimized for speed and may not necessarily yield the exact result.
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.
FromColour
#Create a standard gradient from black (0.0) to white (1.0) via colour. The colour grip is placed at its luminance equivalent within the gradient.
FromSolidColour
#Create a gradient with a single colour.
IsConstant
#Tests whether this gradient has a zero-length domain and whether the colours on either side are identical.
Returns: True if gradient only has a single colour.
Remap
#Create a new gradient which is similar to this gradient but remapped to a different interval.
Returns: Mapped gradient.
Remap
#Create a new gradient which is similar to this gradient but remapped to a different interval.
Returns: Mapped gradient.
RemapAutomatic
#Remap this gradient to a new domain if the mapping has automatic lower or upper bounds.
TryParse
#Try and pase a gradient from text. This will both find standard and custom gradients by name, remapped standard or custom gradients and grip gradients defined from scratch.