# Gradient class

Namespace: [Grasshopper2.Types.Colour](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.types.colour.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public abstract class Gradient : IStorable
```

Base class for all Grasshopper gradients. Consider using [GripGradient](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gripgradient.md) as a ready-made implementation.

**Derived types:** [FunctionGradient](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.functiongradient.md), [GripGradient](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gripgradient.md)

## Constructors

- [Gradient](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/ctor.md): (2 overloads) Constructor.

## Properties

- [ApparentDomain](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/apparentdomain.md): Gets the domain based on the [Gradient.Mapping](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/mapping.md) of this gradient. Note that this domain may be decreasing.
- [Interaction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/interaction.md): Gets a user interaction object based on this gradient. Not all gradient types will have interaction objects.
- [IntrinsicDomain](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/intrinsicdomain.md): Gets the interval containing the defined interior of this gradient. Note that this refers to the mathematics underlying the gradient, the [Gradient.ApparentDomain](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/apparentdomain.md) encodes the publicly facing domain of this gradient.
- [Mapping](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/mapping.md): Gets the mapping from sampling space to gradient space.

## Methods

- [ColourAt](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/colourat.md): (2 overloads) Gets the exact colour at the given parameter.
- [ColourAtInternal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/colouratinternal.md): Sample the gradient at the given gradient parameter.
- [CreateTextureCache](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/createtexturecache.md): Create a texture cache object for displaying this texture in the UI. The width of the texture bitmap ought to be decided by the callee.
- [Draw](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/draw.md): (2 overloads) Draw this gradient as a horizontal progression. This method is optimized for speed and may not necessarily yield the exact result.
- [FromColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/fromcolour.md): (static) Create a standard gradient from black (0.0) to white (1.0) via colour. The colour grip is placed at its luminance equivalent within the gradient.
- [FromSolidColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/fromsolidcolour.md): (static) Create a gradient with a single colour.
- [IsConstant](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/isconstant.md): Tests whether this gradient has a zero-length domain and whether the colours on either side are identical.
- [Remap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/remap.md): (2 overloads) Create a new gradient which is similar to this gradient but remapped to a different interval.
- [RemapAutomatic](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/remapautomatic.md): Remap this gradient to a new domain if the mapping has automatic lower or upper bounds.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/store.md): Serialisation method.
- [ToBitmap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/tobitmap.md): (2 overloads) Render this gradient to a bitmap using exact per-pixel colours.
- [TryParse](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/tryparse.md): (static) Try and pase a gradient from text. This will both find standard and custom gradients by name, remapped standard or custom gradients and grip gradients defined from scratch.
- [WithAutomaticLimits](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/withautomaticlimits.md): Adjust the automatic bounds flags for this gradient.

## Operators

- [operator +](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/op-addition.md): (3 overloads, static)
- [operator /](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/op-division.md): (3 overloads, static)
- [operator *](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/op-multiply.md): (3 overloads, static)
- [operator -](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/op-subtraction.md): (3 overloads, static)
- [operator -](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.gradient/op-unarynegation.md): (static)
