GH_ColourPickerBase

References
Provides Colour picker GUI not tied to a control-handle.

Constructors

GH_ColourPickerBase

#
Create a new instance of the Colour Picker base control. This constructor assigns the default Colour space model and involves a call to the Grasshopper core settings server. You must call SetupColourPicker() prior to rendering this control on screen.
public GH_ColourPickerBase()

Properties

AutoSize

#
Gets or sets a value indicating whether the width and height of the Bounds are adjusted to fit the UI.
[Category("Display")] public bool AutoSize { get; set; }

BackColour

#
Gets or sets the background colour of the picker.
public Color BackColour { get; set; }

BaseColour

#
Gets the original base colour for this picker. Use SetupColourPicker to assign this colour.
[Category("Colours")] public Color BaseColour { get; }

BaseColourBox

#
Gets the rectangle containing the base colour swatch.
[Browsable(false)] public Rectangle BaseColourBox { get; }

Bounds

#
Gets or sets the Bounds for this control.
[Category("Display")] public Rectangle Bounds { get; set; }

ChannelBox0

#
Gets the rectangle containing the tag string for the first channel slider.
[Browsable(false)] public Rectangle ChannelBox0 { get; }

ChannelBox1

#
Gets the rectangle containing the tag string for the second channel slider.
[Browsable(false)] public Rectangle ChannelBox1 { get; }

ChannelBox2

#
Gets the rectangle containing the tag string for the third channel slider.
[Browsable(false)] public Rectangle ChannelBox2 { get; }

ChannelBox3

#
Gets the rectangle containing the tag string for the fourth channel slider.
[Browsable(false)] public Rectangle ChannelBox3 { get; }

ColourCubeBox

#
Gets the rectangle that contains the colour space cube.
[Browsable(false)] public Rectangle ColourCubeBox { get; }

ColourSpace

#
Gets the Colour space mode used in this picker.
public GH_ColourSpace ColourSpace { get; }

Cube

#
Gets the graphics object that describes the current colour cube.
[Browsable(false)] public GH_ColourCube Cube { get; }

DesiredHeight

#
Gets the ideal height for this colour picker given it's width and UI settings.
public int DesiredHeight { get; }

DrawAlphaSlider

#
Gets or sets whether or not the alpha slider is included in the UI.
[Category("Display")] public bool DrawAlphaSlider { get; set; }

DrawBackground

#
Gets or sets whether the background of the picker is drawn.
[Category("Display")] public bool DrawBackground { get; set; }

DrawChannelSliders

#
Gets or sets whether or not the three basic channel sliders are included in the UI.
[Category("Display")] public bool DrawChannelSliders { get; set; }

DropperPreviewBox

#
Gets the rectangle in which the eye-dropped preview will be drawn.
public Rectangle DropperPreviewBox { get; }

Font

#
Gets or sets the Font used in this Colour Picker. Do not Dispose the Font returned by this property.
public Font Font { get; set; }

HSVSpaceBox

#
Gets the rectangle containing the base colour space.
[Browsable(false)] public Rectangle HSVSpaceBox { get; }

IsTextInput

#
Gets whether any of the slider is currently displaying a text input box.
public bool IsTextInput { get; }

Padding

#
Gets or sets the Padding for this control.
[Category("Display")] public Padding Padding { get; set; }

PickColour

#
Gets the picked colour.
[Category("Colours")] public Color PickColour { get; }

PickColourBox

#
Gets the rectangle containing the pick colour swatch.
[Browsable(false)] public Rectangle PickColourBox { get; }

RGBSpaceBox

#
Gets the rectangle containing the pick colour space.
[Browsable(false)] public Rectangle RGBSpaceBox { get; }

SRCSpaceBox

#
Gets the rectangle containing the eye-dropper function.
public Rectangle SRCSpaceBox { get; }

Methods

Invalidate

#
Raise the Invalidated event.
public void Invalidate()

MouseClick

#
Respond to mouse-click events.
public bool MouseClick(
args,
Mouse Event arguments.
PointF
pt
Mouse cursor position in floating point accuracy.
)
True if a Drag operation was terminated, false if the event went unnoticed.

MouseDoubleClick

#
Respond to mouse-doubleclick events.
public bool MouseDoubleClick(
args,
Mouse Event arguments.
PointF
pt,
Mouse cursor position in floating point accuracy.
Control
owner,
Owner control for this colour-picker.
Matrix
transform
Display Transformation matrix of colour-picker.
)

MouseDown

#
Respond to mouse-down events.
public bool MouseDown(
args,
Mouse Event arguments.
PointF
pt
Mouse cursor position in floating point accuracy.
)
True if a Drag operation was started, false if the event went unnoticed.

MouseMove

#
Respond to mouse-move events.
public bool MouseMove(
args,
Mouse Event arguments.
PointF
pt
Mouse cursor position in floating point accuracy.
)
True if a Drag operation was performed, false if the event went unnoticed.

MouseUp

#
Respond to mouse-up events.
public bool MouseUp(
args,
Mouse Event arguments.
PointF
pt
Mouse cursor position in floating point accuracy.
)
True if a Drag operation was terminated, false if the event went unnoticed.

OnColorChanged

#
Raise the ColorChanged event.
public void OnColorChanged(
intermediate
Set the intermediate state of the event arguments.
)

Render

#
Render this slider into a Graphics context.
public void Render(
G
Graphics to render with.
)

RespondToEnter

#
public GH_ToolstripItemKeyHandlerResult RespondToEnter()
RespondToEnter

RespondToEscape

#
public GH_ToolstripItemKeyHandlerResult RespondToEscape()
RespondToEscape

SetUiScaling

#
public void SetUiScaling(
factor
)

SetupColourPicker

#
Setup all UI elements.
public void SetupColourPicker(
Color
col0,
Initial colour for this picker.
Color
col1,
Active colour for this picker.
space
Colour space mode for this picker.
)

SetupColourPicker

#
Setup all UI elements.
public void SetupColourPicker(
Color
col0,
Initial colour for this picker.
col1,
Active colour for this picker.
space
Colour space mode for this picker.
)

Events

ColorChanged

#
Raised whenever the color of this picker is changed due to User-Interface methods.

Invalidated

#
Raised whenever a redraw is required.
public event GH_ColourPickerBase.InvalidatedEventHandler Invalidated