GH_Gradient
Represents a colour gradient defined by a succession of grips.
Inheritance Hierarchy
System.Object
Grasshopper.GUI.Gradient.GH_Gradient
Namespace: Grasshopper.GUI.Gradient
Assembly: Grasshopper (in Grasshopper.dll)
Syntax
public class GH_Gradient : GH_ISerializable, IGradient
The GH_Gradient type exposes the following members.
Constructors
Name
Description
Public Method
GH_Gradient.
Initializes a new instance of the GH_Gradient class
Public Method
GH_Gradient(GH_Gradient)
Create a duplicate of another gradient.
Public Method
GH_Gradient(IEnumerable.Double., IEnumerable.Color.)
Create a new gradient from grips and colours.
Properties
Name
Description
Public Property
Grip
Gets or sets the grip at the given index.
Public Property
GripCount
Gets the number of grips in this gradient.
Public Property
Linear
Gets or sets whether the colours are interpolated linearly between grips.
Public Property
Locked
Gets or sets whether this gradient is locked. A locked gradient cannot be modified by the user.
Public Property
SelectedGrip
Gets or sets the selected grip.
Methods
Name
Description
Public Method
AddGrip(Double)
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.
Public Method
AddGrip(GH_Grip)
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().
Public Method
AddGrip(Double, Color)
Add a new single-colour grip.
Public Method
AddGrip(Double, Color, Color)
Add a new bi-colour grip.
Public Method
ColourAt
Evaluate the colour at a specific parameter.
Public Method
Static Member
DeleteGripRegion
Gets the Delete Grip region rectangle based on a gradient destination rectangle.
Public Method
DisplayGradientEditor
Public Method
DisplayGripColourPicker
Public Method
Static Member
EarthlyBrown
Public Method
Static Member
Forest
Public Method
Static Member
GreyScale
Public Method
Static Member
Heat
Public Method
MouseDown
Begin grip drag operation.
Public Method
MouseDragAbort
Abort grip drag.
Public Method
MouseMove
Continue grip dragging operation.
Public Method
MouseUp
Terminate grip drag.
Public Method
NearestGrip(Double)
Find the nearest grip to a parameter.
Public Method
NearestGrip(Double, GH_GripSide)
Find the nearest grip to a parameter.
Public Method
NearestGrip(RectangleF, PointF, Double)
Find the nearest grip in screen coordinates.
Public Method
Static Member
NewGripRegion
Gets the new Grip region rectangle based on a gradient destination rectangle.
Public Method
NormalizeGrips
Normalize all grips. This will scale all grip parameters so that the full gradient extend equals 0~1.
Public Method
OnGradientChanged
Raise the GradientChanged event.
Public Method
OnGradientChangedIntermediate
Raise the GradientChanged event.
Public Method
OnSelectionChanged
Raise the SelectionChanged event.
Public Method
Read
Public Method
RemoveGrip(GH_Grip)
Remove the specified grip.
Public Method
RemoveGrip(Int32)
Remove the grip at the specified index.
Public Method
Render_Background
Public Method
Render_Gradient
Public Method
Render_Grips
Public Method
Static Member
SoGay
Public Method
Static Member
Spectrum
Public Method
Static Member
Traffic
Public Method
Write
Public Method
Static Member
Zebra
Events
Name
Description
Public Event
GradientChanged
Public Event
SelectionChanged