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.
ColourAt
#Gets the 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.
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
#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. |
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.
Parameters:
| colour (Colour) | Colour on the interior of the gradient. |
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.
Remap
#Create a new gradient which is similar to this gradient but remapped to a different interval.
Remap
#Create a new gradient which is similar to this gradient but remapped to a different interval.
Parameters:
| newMapping (GradientMapping) |
Returns: Mapped gradient.
RemapAutomatic
#Remap this gradient to a new domain if the mapping has automatic lower or upper bounds.
ToBitmap
#Render this gradient to a bitmap using exact per-pixel colours.
ToBitmap
#Render this gradient to a bitmap.