Hey,
Got a bit of a question (which relates to the GH_ColourPicker and my learning of Event Handling. I want to store the colour that is picked into a class variable called ‘colour’. I’ve tried a few things, but nothing seems to get it to pass it to the class variable. Any help would be much appreciated.
System.Drawing.Color colour;
protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
{
// Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
Grasshopper.GUI.GH_ColourPicker fade_colour = GH_DocumentObject.Menu_AppendColourPicker(menu, colour, colour_changed);
}
private void colour_changed(object sender, EventArgs e)
{
colour = (sender as Grasshopper.GUI.GH_ColourPicker).Colour;
}