# ColourPicker class

Namespace: [Grasshopper2.UI.ColourPicker](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.colourpicker.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class ColourPicker : IResponsive
```

Represents the core functionality of the Grasshopper colour picker.

## Constructors

- [ColourPicker](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/ctor.md): (3 overloads) Create a new colour picker, centered on a specific colour using the most recent model and palette constraints.

## Fields

- [ButtonSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/buttonsize.md): (static) Specifies the height of the Accept/Revert buttons.
- [ButtonSpacing](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/buttonspacing.md): (static) The spacing between the sliders and the buttons.
- [DiagramSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/diagramsize.md): (static) Specifies the ideal width and height of the colour space diagram.
- [LabelSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/labelsize.md): (static) Specifies the height of a textual label.
- [SamplerSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/samplersize.md): (static) Specifies the radius of the sampler button.
- [SliderSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/slidersize.md): (static) Specifies the height of channel sliders.
- [ToolbarSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/toolbarsize.md): (static) Specifies the height of toolbars and buttons.

## Properties

- [AcceptButton](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/acceptbutton.md): Gets the region for the Accept button.
- [AcceptButtonInfo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/acceptbuttoninfo.md): Gets or set the text for the accept button tooltip.
- [AcceptButtonText](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/acceptbuttontext.md): Gets or sets the text on the accept button.
- [AvailableSpaces](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/availablespaces.md): Enumerate over all colour spaces available in this picker.
- [Bounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/bounds.md): Gets the bounding rectangle for all UI elements in the picker.
- [Channel1](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/channel1.md): Gets the bounding rectangle for the first channel slider.
- [Channel2](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/channel2.md): Gets the bounding rectangle for the second channel slider.
- [Channel3](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/channel3.md): Gets the bounding rectangle for the third channel slider.
- [ChannelA](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/channela.md): Gets the bounding rectangle for the alpha channel slider.
- [ChildResponsives](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/childresponsives.md): Sliders this picker hosts as standalone responsive children. The hosting control should register each of these as an [IResponsive](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.flex.iresponsive.md) so the FlexControl dispatcher routes slider drags through their own Responsive instances instead of going through the picker.
- [ColourInfo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/colourinfo.md): Gets the bounding rectangle of the colour code label.
- [CurrentColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/currentcolour.md): Gets the currently selected colour within the current colour model. This does not take discretisation into account. You *probably* want to use the [ColourPicker.ImpliedColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/impliedcolour.md) property.
- [Diagram](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/diagram.md): Gets the bounding rectangle of the colour space diagram.
- [DisplayDiscrete](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/displaydiscrete.md): Gets or sets whether to limit the colours in the model space to the currently loaded palette.
- [Format](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/format.md): Gets or sets the textual format in which colours are displayed. Caller is responsible for triggering a redraw of the control.
- [Height](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/height.md): Gets the ideal height of this colour picker in the UI.
- [ImpliedColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/impliedcolour.md): Gets the currently implied colour, taking into account discretisation.
- [IncludeContextuals](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/includecontextuals.md): Gets whether the layout specifies the inclusion of the contextual icon colour model.
- [InitialColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/initialcolour.md): Gets the initial (original) colour this colour picker was constructed with.
- [Layout](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/layout.md): Gets whether this picker includes UI for transparency.
- [ModelName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/modelname.md): Gets the bounding rectangle of the colour space name label.
- [ModelToolbar](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/modeltoolbar.md): Gets the bounding rectangle of the toolbar containing all colour spaces.
- [MostRecentDiscrete](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/mostrecentdiscrete.md): (static) Gets or sets the most recently used discrete mode. This will be the default for any new colour picker.
- [MostRecentFormat](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/mostrecentformat.md): (static) Gets or sets the most recently selected colour format. This will be the default for any new colour picker.
- [MostRecentPalette](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/mostrecentpalette.md): (static) Gets or sets the most recently selected colour space. This will be the default for any new colour picker.
- [MostRecentSpace](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/mostrecentspace.md): (static) Gets or sets the most recently selected colour space. This will be the default for any new colour picker.
- [Palette](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/palette.md): Gets the palette indicated buy the [ColourPicker.PaletteName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/palettename.md) property.
- [PaletteName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/palettename.md): Gets the name of the palette currently loaded in the picker.
- [Responder](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/responder.md)
- [RevertButton](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/revertbutton.md): Gets the region for the Revert button.
- [SamplerButton](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/samplerbutton.md): Gets the region for the Screen Sampler button.
- [Space](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/space.md): Gets the colour space currently on display.
- [Width](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/width.md): Gets the ideal width of this colour picker in the UI.

## Methods

- [ComputeBounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/computebounds.md): (static) Compute the bounds based on a specific layout.
- [Draw](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/draw.md): Draw this colour picker to a graphics context.
- [ModelButton](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/modelbutton.md): Resolve the bounds for the specific space button on the space toolbar.
- [PerformLayout](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/performlayout.md): Perform layout of the picker. This happens automatically within each Draw iteration, but you can call it specifically if you need to examine the boundaries prior to a draw operation.
- [SpaceInstance](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/spaceinstance.md): Gets the instance of the given space. Do not modify these instances unless you understand what consequences that might have to the validity of the picker state.

## Events

- [ColourAccepted](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/colouraccepted.md): Raised when the current colour is accepted.
- [DisplayExpired](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/displayexpired.md): Raised whenever the picker needs to be redrawn.
- [ImpliedColourChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/impliedcolourchanged.md): Raised when the implied colour is changed.
- [SpaceChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/spacechanged.md): Raised when a different model is selected.
- [SpatialColourChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.colourpicker.colourpicker/spatialcolourchanged.md): Raised when a new colour is picked.
