# ColourMap class

Namespace: [Grasshopper2.Imaging](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.imaging.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class ColourMap
```

Represents an immutable rectangular grid of colours.

## Constructors

- [ColourMap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/ctor.md): (4 overloads) Create a colour map from a rectangular array of colours.

## Properties

- [A](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/a.md): Gets the alpha channel.
- [B](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/b.md): Gets the blue channel.
- [Constant](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/constant.md): Gets the constant value of this map. If IsConstant is not true, this value is meaningless.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/count.md): Gets the total number of entries in this map.
- [G](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/g.md): Gets the green channel.
- [Height](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/height.md): Gets the height of the map.
- [IsConstant](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/isconstant.md): Gets whether this map contains only a single value.
- [OpaqueCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/opaquecount.md): Gets the number of colours in this map that are fully opaque.
- [R](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/r.md): Gets the red channel.
- [TransparentCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/transparentcount.md): Gets the number of colours in this map that are fully transparent.
- [Width](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/width.md): Gets the width of the map.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/item.md): Gets the colour at the given (x,y) coordinate. If the map is constant this indexer will throw.

## Methods

- [Blur](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/blur.md): (2 overloads) Blur this colour map.
- [Clip](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/clip.md): (static) Clip the entire colour map, ie. ensure all channels are within the (0~1) range.
- [CreateFromBitmap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/createfrombitmap.md): (2 overloads, static) Copy the bitmap colours into a ColourMap.
- [CreateFromDelegate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/createfromdelegate.md): (static) Populate a colour map using a shader delegate.
- [CreateFromImage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/createfromimage.md): (static) Copy the image colours into a ColourMap.
- [Gamma](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/gamma.md): (static) Perform a gamma adjustment on this colour map.
- [Invert](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/invert.md): (static) Perform a gamma adjustment on this colour map.
- [Modify](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/modify.md): (static) Apply a custom modifier to this map.
- [SetChannel](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/setchannel.md): (static) Set the specified channel value of each colour.
- [SubMap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/submap.md): Copy a portion of this map into a new map.
- [Tabulate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/tabulate.md): (2 overloads, static) Pull all values in a map to a collection of allowed values.
- [ToBitmap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/tobitmap.md): (2 overloads) Create a bitmap out of this colour map.
- [ToColourArray](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/tocolourarray.md): Create a nested colour array from this map.
- [Ungamma](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/ungamma.md): (static) Perform a reverse gamma adjustment on this colour map.

## Operators

- [operator +](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/op-addition.md): (3 overloads, static) Add a value to this float map.
- [operator *](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/op-multiply.md): (5 overloads, static) Multiply this map by a factor.
- [operator -](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/op-subtraction.md): (3 overloads, static) Subtract the entire map from a value.
- [operator -](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/op-unarynegation.md): (static) Inversion operator.
- [operator +](https://developer.rhino3d.com/api/gh2/type/grasshopper2.imaging.colourmap/op-unaryplus.md): (static) Identity operator.
