algorithmic modeling for Rhino
Hi everyone,
I would like to change the backgound color of my component. My approach was to override the render method in the GH_ComponentAttributes class (e.g. https://discourse.mcneel.com/t/custome-node-color/7427):
protected override void Render(GH_Canvas canvas, Graphics graphics, GH_CanvasChannel channel)
{
// Change Color
GH_PaletteStyle styleStandard = null;
GH_PaletteStyle styleSelected = null;
if (channel == GH_CanvasChannel.Objects)
{
// Cache the current styles.
styleStandard = GH_Skin.palette_normal_standard;
styleSelected = GH_Skin.palette_normal_selected;
GH_Skin.palette_normal_standard = new GH_PaletteStyle(Color.HotPink, Color.Maroon, Color.DarkRed);
GH_Skin.palette_normal_selected = new GH_PaletteStyle(Color.SkyBlue, Color.DarkBlue, Color.Black);
}
}
This appraoch is almost working. But if I register custom GH_Params in my pManager of the component, it will fail. Any ideas what I have to consider by using custom params?
Thanks in advance. Cheers,
Daniel
Tags:
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2025 Created by Scott Davidson.
Powered by