# Colour 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
[IoId("00000000-c3b4-48fe-9367-bb4402cf6471")]
public sealed class Colour : IStorable, IEquatable<Colour>
```

Provides a way to store colours using a variety of spaces using high-precision mathematics. This is the class Grasshopper uses internally to store colours. Rhino, Eto, and .NET have their own colour types (usually [ColorRGBA](https://mcneel-apidocs-rhinocommon-7f6eb10c6967.herokuapp.com/api/rhinocommon/type/rhino.display.colorrgba/), `Color`, and [Color](https://learn.microsoft.com/dotnet/api/system.drawing.color), but there are many more), so you may need to convert to and from those types to [Colour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour.md) on a per-case basis.

## Constructors

- [Colour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/ctor.md)

## Fields

- [NameCMY](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namecmy.md): (static)
- [NameCMYK](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namecmyk.md): (static)
- [NameHSL](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namehsl.md): (static)
- [NameHSP](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namehsp.md): (static)
- [NameHSV](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namehsv.md): (static)
- [NameIcon](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/nameicon.md): (static)
- [NameLAB](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namelab.md): (static)
- [NameOKLAB](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/nameoklab.md): (static)
- [NameRGB](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namergb.md): (static)
- [NameRGBLinear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namergblinear.md): (static)
- [NameSRGB](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namesrgb.md): (static)
- [NameXYZ](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/namexyz.md): (static)
- [NameYXY](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/nameyxy.md): (static)
- [OfficialNameCMY](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamecmy.md): (static)
- [OfficialNameCMYK](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamecmyk.md): (static)
- [OfficialNameHSL](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamehsl.md): (static)
- [OfficialNameHSP](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamehsp.md): (static)
- [OfficialNameHSV](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamehsv.md): (static)
- [OfficialNameIcon](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnameicon.md): (static)
- [OfficialNameLAB](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamelab.md): (static)
- [OfficialNameOKLAB](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnameoklab.md): (static)
- [OfficialNameRGB](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamergb.md): (static)
- [OfficialNameRGBLinear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamergblinear.md): (static)
- [OfficialNameSRGB](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamesrgb.md): (static)
- [OfficialNameXYZ](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnamexyz.md): (static)
- [OfficialNameYXY](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/officialnameyxy.md): (static)

## Properties

- [Alpha](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/alpha.md): Gets the alpha channel or transparency for this colour.
- [ChannelCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/channelcount.md): Gets the number of channels.
- [Space](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/space.md): Gets the model this colour is defined in.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/item.md): Gets the channel value with the given index.

## Methods

- [Equals](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/equals.md): (3 overloads)
- [FromCmy](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromcmy.md): (static) Create a new CMY colour.
- [FromCmyk](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromcmyk.md): (static) Create a new CMYK colour.
- [FromEto](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/frometo.md): (static) Create a new sRGB or Special colour based on an `Color`.
- [FromGdi](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromgdi.md): (static) Create a new sRGB or Special colour based on a [Color](https://learn.microsoft.com/dotnet/api/system.drawing.color).
- [FromHsl](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromhsl.md): (static) Create a new HSL colour.
- [FromHsp](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromhsp.md): (static) Create a new H*SP colour.
- [FromHsv](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromhsv.md): (static) Create a new HSV (HSB) colour.
- [FromLab](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromlab.md): (static) Create a new Cie Yxy colour.
- [FromOklab](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromoklab.md): (static) Create a new Oklab colour.
- [FromOklch](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromoklch.md): (static) Create a new Oklab colour from its polar Oklch form.
- [FromRgb](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromrgb.md): (static) Create a new sRGB colour.
- [FromRgbLinear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromrgblinear.md): (static) Create a new linear RGB colour.
- [FromSpecial](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromspecial.md): (static) Create a new Icon colour from a special hint.
- [FromXyz](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromxyz.md): (static) Create a new Cie XYZ colour.
- [FromYxy](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/fromyxy.md): (static) Create a new Cie Yxy colour.
- [GetHashCode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/gethashcode.md)
- [IStorable.Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/grasshopperio-istorable-store.md)
- [ToEto](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/toeto.md): Convert this colour to an `Color`.
- [ToNamedString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/tonamedstring.md): (2 overloads) Returns the name of this colour, or a description of its channels. The name is only returned if this colour is defined in sRGB.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/tostring.md): Returns the fully qualified type name of this instance.
- [WithAlpha](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/withalpha.md): Modify the alpha of this colour.
- [WithChannels](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/withchannels.md): Modify the channels of this colour.
- [WithSpace](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/withspace.md): Modify the space in which this colour is defined.

## Operators

- [operator +](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/op-addition.md): (3 overloads, static) Add two colours in the Linear RGB space.
- [operator /](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/op-division.md): (3 overloads, static) Divide two colours in the Linear RGB space, which is actually the Screen blending mode.
- [operator ==](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/op-equality.md): (static) Test for equality.
- [operator !=](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/op-inequality.md): (static) Test for inequality.
- [operator *](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/op-multiply.md): (3 overloads, static) Multiply two colours in the Linear RGB space.
- [operator -](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/op-subtraction.md): (3 overloads, static) Subtract two colours in the Linear RGB space.
- [operator -](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/op-unarynegation.md): (static) Negate a colour in the Linear RGB space.

## Convertors

- [operator implicit](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.colour.colour/op-implicit.md): (2 overloads, static)
