# GH_Gradient class

Namespace: [Grasshopper.GUI.Gradient](https://developer.rhino3d.com/api/gh1/namespace/grasshopper.gui.gradient.md) · Assembly: [Grasshopper](https://developer.rhino3d.com/api/gh1/assembly/grasshopper.md)

```cs
public class GH_Gradient : GH_ISerializable, IGradient
```

Represents a colour gradient defined by a succession of grips.

## Constructors

- [GH_Gradient](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/ctor.md): (3 overloads)

## Properties

- [GripCount](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/gripcount.md): Gets the number of grips in this gradient.
- [Linear](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/linear.md): Gets or sets whether the colours are interpolated linearly between grips.
- [Locked](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/locked.md): Gets or sets whether this gradient is locked. A locked gradient cannot be modified by the user.
- [SelectedGrip](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/selectedgrip.md): Gets or sets the selected grip.

## Indexers

- [Grip](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/item.md): Gets or sets the grip at the given index.

## Methods

- [IGradient.AddCurrentAsPreset](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/addcurrentaspreset.md): Adds a copy of this gradient to the shared Grasshopper preset collection.
- [AddGrip](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/addgrip.md): (4 overloads) Add a new single-colour grip.
- [ColourAt](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/colourat.md): Evaluate the colour at a specific parameter.
- [DeleteGripRegion](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/deletegripregion.md): (static) Gets the Delete Grip region rectangle based on a gradient destination rectangle.
- [IGradient.DeletePreset](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/deletepreset.md): Removes the preset at the given index from the shared Grasshopper preset collection.
- [DisplayGradientEditor](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/displaygradienteditor.md)
- [DisplayGripColourPicker](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/displaygripcolourpicker.md)
- [IGradient.DrawToGraphics](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/drawtographics.md)
- [EarthlyBrown](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/earthlybrown.md): (static)
- [Forest](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/forest.md): (static)
- [IGradient.GetColorStops](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/getcolorstops.md)
- [IGradient.GetPresets](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/getpresets.md): Returns the shared Grasshopper gradient presets as color stop collections. Reads the same [grasshopper_gradients] settings database used by the Gradient component.
- [GreyScale](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/greyscale.md): (static)
- [Heat](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/heat.md): (static)
- [MouseDown](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/mousedown.md): Begin grip drag operation.
- [MouseDragAbort](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/mousedragabort.md): Abort grip drag.
- [MouseMove](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/mousemove.md): Continue grip dragging operation.
- [MouseUp](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/mouseup.md): Terminate grip drag.
- [NearestGrip](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/nearestgrip.md): (3 overloads) Find the nearest grip to a parameter.
- [NewGripRegion](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/newgripregion.md): (static) Gets the new Grip region rectangle based on a gradient destination rectangle.
- [NormalizeGrips](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/normalizegrips.md): Normalize all grips. This will scale all grip parameters so that the full gradient extend equals 0~1.
- [OnGradientChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/ongradientchanged.md): Raise the GradientChanged event.
- [OnGradientChangedIntermediate](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/ongradientchangedintermediate.md): Raise the GradientChanged event.
- [OnSelectionChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/onselectionchanged.md): Raise the SelectionChanged event.
- [Read](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/read.md)
- [RemoveGrip](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/removegrip.md): (2 overloads) Remove the specified grip.
- [Render_Background](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/render-background.md)
- [Render_Gradient](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/render-gradient.md)
- [Render_Grips](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/render-grips.md)
- [IGradient.RhinoUiMouseDown](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/rhinouimousedown.md)
- [IGradient.SetColorStops](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/setcolorstops.md)
- [IGradient.SetDefault](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/setdefault.md): Stores the given color stops as the shared Grasshopper default gradient.
- [SoGay](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/sogay.md): (static)
- [Spectrum](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/spectrum.md): (static)
- [Traffic](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/traffic.md): (static)
- [Write](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/write.md)
- [Zebra](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/zebra.md): (static)

## Events

- [GradientChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/gradientchanged.md)
- [IGradient.RhinoUiGradientChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/rhinouigradientchanged.md)
- [IGradient.RhinoUiSelectionChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/rhinouiselectionchanged.md)
- [SelectionChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gradient.gh-gradient/selectionchanged.md)
