Click or drag to resize

GH_Gradient Class

Represents a colour gradient defined by a succession of grips.
Inheritance Hierarchy
SystemObject
  Grasshopper.GUI.GradientGH_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
Properties
  NameDescription
Public propertyGrip
Gets or sets the grip at the given index.
Public propertyGripCount
Gets the number of grips in this gradient.
Public propertyLinear
Gets or sets whether the colours are interpolated linearly between grips.
Public propertyLocked
Gets or sets whether this gradient is locked. A locked gradient cannot be modified by the user.
Public propertySelectedGrip
Gets or sets the selected grip.
Top
Methods
  NameDescription
Public methodAddGrip(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 methodAddGrip(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 methodAddGrip(Double, Color)
Add a new single-colour grip.
Public methodAddGrip(Double, Color, Color)
Add a new bi-colour grip.
Public methodColourAt
Evaluate the colour at a specific parameter.
Public methodStatic memberDeleteGripRegion
Gets the Delete Grip region rectangle based on a gradient destination rectangle.
Public methodDisplayGradientEditor
Public methodDisplayGripColourPicker
Public methodStatic memberEarthlyBrown
Public methodStatic memberForest
Public methodStatic memberGreyScale
Public methodStatic memberHeat
Public methodMouseDown
Begin grip drag operation.
Public methodMouseDragAbort
Abort grip drag.
Public methodMouseMove
Continue grip dragging operation.
Public methodMouseUp
Terminate grip drag.
Public methodNearestGrip(Double)
Find the nearest grip to a parameter.
Public methodNearestGrip(Double, GH_GripSide)
Find the nearest grip to a parameter.
Public methodNearestGrip(RectangleF, PointF, Double)
Find the nearest grip in screen coordinates.
Public methodStatic memberNewGripRegion
Gets the new Grip region rectangle based on a gradient destination rectangle.
Public methodNormalizeGrips
Normalize all grips. This will scale all grip parameters so that the full gradient extend equals 0~1.
Public methodOnGradientChanged
Raise the GradientChanged event.
Public methodOnGradientChangedIntermediate
Raise the GradientChanged event.
Public methodOnSelectionChanged
Raise the SelectionChanged event.
Public methodRead
Public methodRemoveGrip(GH_Grip)
Remove the specified grip.
Public methodRemoveGrip(Int32)
Remove the grip at the specified index.
Public methodRender_Background
Public methodRender_Gradient
Public methodRender_Grips
Public methodStatic memberSoGay
Public methodStatic memberSpectrum
Public methodStatic memberTraffic
Public methodWrite
Public methodStatic memberZebra
Top
Events
See Also