Constructors
GH_Gradient
#public GH_Gradient()
GH_Gradient
#public GH_Gradient(GH_Gradient other)
Create a duplicate of another gradient.
Parameters:
| other (GH_Gradient) | Gradient to duplicate. |
GH_Gradient
#Create a new gradient from grips and colours.
Parameters:
| parameters (IEnumerable<double>) | Grip locations. |
| colours (IEnumerable<Color>) | Colours for each grip. |
Properties
Indexers
Methods
void AddCurrentAsPreset()
Adds a copy of this gradient to the shared Grasshopper preset collection.
AddGrip
#Add a new single-colour grip.
AddGrip
#Add a new bi-colour grip.
AddGrip
#Add a new grip to the gradient. The colour of the grip will be picked so that there is no difference to the gradient, though this is not actually possible when the interpolation mode is not linear.
Parameters:
| t (double) | Grip parameter. |
AddGrip
#Add a new grip to the gradient. This method does not raise the GradientChanged event, so you need to do that yourself by calling OnGradientChanged().
Parameters:
| grip (GH_Grip) | Grip to add. |
ColourAt
#Evaluate the colour at a specific parameter.
Parameters:
| t (double) | Parameter to evaluate. |
Returns: The colour at the given parameter.
DeleteGripRegion
#Gets the Delete Grip region rectangle based on a gradient destination rectangle.
Parameters:
| destination (RectangleF) | Gradient destination rectangle. |
Removes the preset at the given index from the shared Grasshopper preset collection.
Parameters:
| index (int) |
DisplayGradientEditor
#public void DisplayGradientEditor()
Parameters:
| g (Graphics) | |
| dest (RectangleF) |
EarthlyBrown
#Forest
#Returns the shared Grasshopper gradient presets as color stop collections. Reads the same [grasshopper_gradients] settings database used by the Gradient component.
GreyScale
#Heat
#MouseDown
#Begin grip drag operation.
Parameters:
| dest (RectangleF) | Destination rectangle of the gradient. |
| pt (PointF) | Mouse position in destination coordinates. |
Returns: True if a grip drag was started, false otherwise.
MouseMove
#Continue grip dragging operation.
Parameters:
| dest (RectangleF) | Destination rectangle of gradient. |
| pt (PointF) | Mouse position in destination coordinates. |
Returns: True if a grip position was changed, false otherwise. Redraws are only required on TRUE.
MouseUp
#Terminate grip drag.
Parameters:
| dest (RectangleF) | Destination rectangle of gradient |
| pt (PointF) | Mouse location in destination coordinates |
| deselect (bool) |
NearestGrip
#Find the nearest grip to a parameter.
Parameters:
| t (double) | Parameter to search from. |
| side (GH_GripSide) | Side to search. |
Returns: The grip nearest to the parameter.
NearestGrip
#Find the nearest grip to a parameter.
Parameters:
| t (double) | Parameter to search from. |
Returns: The grip nearest to the parameter.
NearestGrip
#Find the nearest grip in screen coordinates.
Parameters:
| dest (RectangleF) | Retangle that contains the entire gradient. |
| pt (PointF) | Point to search from. |
| maxRadius (double) | Maximum distance between point and grip. |
Returns: The grip closest to the point.
NewGripRegion
#Gets the new Grip region rectangle based on a gradient destination rectangle.
Parameters:
| destination (RectangleF) | Gradient destination rectangle. |
NormalizeGrips
#public void NormalizeGrips()
Normalize all grips. This will scale all grip parameters so that the full gradient extend equals 0~1.
OnGradientChangedIntermediate
#public void OnGradientChangedIntermediate()
Raise the GradientChanged event.
Parameters:
| dest (RectangleF) | |
| pt (PointF) |
Parameters:
| stops (IEnumerable<ColorStop>) |
Stores the given color stops as the shared Grasshopper default gradient.
Parameters:
| stops (IEnumerable<ColorStop>) |