Skip to content

GH_Gradient

Public Class

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

Initializes a new instance of the GH_Gradient class


Public Method

Create a duplicate of another gradient.


Public Method

Create a new gradient from grips and colours.


Properties

Name

Description


Public Property

Gets or sets the grip at the given index.


Public Property

Gets the number of grips in this gradient.


Public Property

Gets or sets whether the colours are interpolated linearly between grips.


Public Property

Gets or sets whether this gradient is locked. A locked gradient cannot be modified by the user.


Public Property

Gets or sets the selected grip.


Methods

Name

Description


Public Method

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

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

Add a new single-colour grip.


Public Method

Add a new bi-colour grip.


Public Method

Evaluate the colour at a specific parameter.


Public Method
Static Member

Gets the Delete Grip region rectangle based on a gradient destination rectangle.


Public Method

Public Method

Public Method
Static Member

Public Method
Static Member

Public Method
Static Member

Public Method
Static Member

Public Method

Begin grip drag operation.


Public Method

Abort grip drag.


Public Method

Continue grip dragging operation.


Public Method

Terminate grip drag.


Public Method

Find the nearest grip to a parameter.


Public Method

Find the nearest grip to a parameter.


Public Method

Find the nearest grip in screen coordinates.


Public Method
Static Member

Gets the new Grip region rectangle based on a gradient destination rectangle.


Public Method

Normalize all grips. This will scale all grip parameters so that the full gradient extend equals 0~1.


Public Method

Raise the GradientChanged event.


Public Method

Raise the GradientChanged event.


Public Method

Raise the SelectionChanged event.


Public Method

Public Method

Remove the specified grip.


Public Method

Remove the grip at the specified index.


Public Method

Public Method

Public Method

Public Method
Static Member

Public Method
Static Member

Public Method
Static Member

Public Method

Public Method
Static Member

Events

Name

Description


Public Event

Public Event