# ColourExtensionMethods class

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

```cs
public static class ColourExtensionMethods
```

Extension methods for Eto.Drawing.Colour

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/add.md): (static) Add two colours.
- [AdjustLevel](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/adjustlevel.md): (static) There are four categories of special colour (Analysis, input, output, symbolic) which have four brighnesses in them (XxxxDark, Xxxx, XxxxLight, XxxxShine). This method will change those brightnesses depending on a level adjustment.
- [Clip](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/clip.md): (static) Clip the channels of a colour to the 0~1 range.
- [Composite](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/composite.md): (static) Create a new colour which acts as the composite of a background and a foreground colour.
- [Contrast](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/contrast.md): (static) Create a contrasting colour useful for foreground/background distinction. Contrast colours retain hue but will change luminance.
- [Darken](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/darken.md): (static) Decrease the luminance of a colour.
- [Desaturate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/desaturate.md): (static) Desaturate a colour by moving its channels to greyscale values.
- [Fade](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/fade.md): (static) Fade a colour to transparency.
- [Gamma](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/gamma.md): (2 overloads, static) Return a gamma-reverted version of this colour. By reverting the gamma, a gamma-adjusted colour is restored into standard sRGB space.
- [GetHue](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/gethue.md): (static) Gets the hue component (0~360) of a colour.
- [GetLuminance](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/getluminance.md): (2 overloads, static) Compute the luminance of a colour.
- [GetSaturation](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/getsaturation.md): (static) Gets the saturation component (0~1) of a colour, as defined by the HSB colour model.
- [Invert](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/invert.md): (static) Create a negative colour. The alpha channel is not inverted.
- [IsDarkBackground](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/isdarkbackground.md): (static) Determines whether a colour qualifies as a dark one, meaning that it requires foreground objects to be of a bright colour.
- [Lighten](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/lighten.md): (static) Increase the luminance of a colour.
- [MoveTo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/moveto.md): (static) Create colour in between this colour and some target colour.
- [Multiply](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/multiply.md): (2 overloads, static) Multiply two colours. This has the effect of looking at the bottom colour through a piece of coloured glass.
- [MultiplyLinear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/multiplylinear.md): (static) Multiply two colours in LinearRGB. This has the effect of looking at the bottom colour through a piece of coloured glass.
- [Offset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/offset.md): (2 overloads, static) Add a fixed value to all the channels in a colour.
- [Palette](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/palette.md): (static) Gets the pair of colours associated with the given process state.
- [PickLeastAlike](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/pickleastalike.md): (static) Pick a colour out of a palette which is the furthest away from other colours.
- [Resolve](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/resolve.md): (static) Resolve a colour based on some context.
- [Rgb_CubeGamma](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/rgb-cubegamma.md): (static) Mapping function from colours to the gamma adjusted (exponent = 2.4) RGB cube.
- [Rgb_CubeSquare](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/rgb-cubesquare.md): (static) Mapping function from colours to the gamma adjusted (exponent = 2.0) RGB cube.
- [Rgb_CubeStandard](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/rgb-cubestandard.md): (static) Mapping function from colours to the sRGB cube.
- [Rgb_CylinderHsl](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/rgb-cylinderhsl.md): (static) Mapping function from colours to the HSL cylinder.
- [Rgb_CylinderHsp](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/rgb-cylinderhsp.md): (static) Mapping function from colours to the HSP* (perceived luminance) cylinder.
- [Rgb_CylinderHsv](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/rgb-cylinderhsv.md): (static) Mapping function from colours to the HSV cylinder.
- [Rgb_Sinusoidal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/rgb-sinusoidal.md): (static) Mapping function from colours to the Hsl sinusoidal space. The projection space is a vertical half sine-wave revolved around the world Z axis. Bottom tip (black) resides at (0,0,-1) while the upper tip (white) can be found at (0,0,+1). The central axis from black to white contains all the greyscale values. Luminance is gamma adjusted and mapped along the vertical axis, hue is mapped around the vertical axis and saturation is mapped to an offset from the vertical axis. The offset is the product of the normalised saturation and the sine of the gamma-adjusted luminance.
- [Round](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/round.md): (static) Round a colour to 1/1000th accuracy in each channel.
- [SetBrightness](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/setbrightness.md): (static) Set the luminance of a colour. This method uses HSV luminance metric.
- [SetHue](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/sethue.md): (static) Set the hue of a colour.
- [SetLuminance](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/setluminance.md): (2 overloads, static) Set the luminance of a colour. This method uses a custom metric and an iterative process.
- [SetSaturation](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/setsaturation.md): (static) Set the saturation of a colour. This method uses HSV saturation metric.
- [Sinusoidal_Rgb](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/sinusoidal-rgb.md): (static) Perform a reverse mapping from sinusoidal coordinates into sRGB coordinates. This conversion may be lossy if the coordinates reside outside the sinusoidal revolved volume.
- [ToBitmap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/tobitmap.md): (static) Create a bitmap filled with this colour.
- [ToEto](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/toeto.md): (2 overloads, static) Convert a GDI+ colour into an Eto colour.
- [ToGdi](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/togdi.md): (static) Convert an eto colour into a GDI colour.
- [ToName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/toname.md): (2 overloads, static) Return the name of the colour space without any whitespace or funky characters
- [ToOfficialName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/toofficialname.md): (2 overloads, static) Return the official name of a colour space including funky characters and whitespace.
- [ToUiColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/touicolour.md): (static) Convert a colour so it will be displayed correctly in the UI. This involves optionally removing all alpha data as well as resolving special colours to their stand-in shades.
- [TryMatchEtoColorName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/trymatchetocolorname.md): (static) Try to find the named colour in Eto.Drawing.Colors which matches this colour. The pure name is returned, without the 'Eto' or the 'Drawing' or the 'Colors'. This method is fairly slow.
- [TryParseSpecialColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/tryparsespecialcolour.md): (static) Test whether a colour is one of the special colour codes.
- [UiColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/uicolour.md): (static) Gets a stand-in colour for the given special colour.
- [UiInfo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/uiinfo.md): (static) Gets a description suitable for use in the UI for a given special colour.
- [UiName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/uiname.md): (static) Gets a name suitable for use in the UI for a given special colour.
- [Ungamma](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/ungamma.md): (2 overloads, static) Return a gamma-adjusted version of this colour. By adjusting the gamma, the colour is moved into a space where linear blending is more natural.
- [WithA](https://developer.rhino3d.com/api/gh2/type/grasshopper2.extensions.colourextensionmethods/witha.md): (static) Set the alpha channel of a colour.
