WISH: Colouring values in a GH panel?

It’d be great if a specific value within a list could be highlighted with a colour in a panel, potentially as a follow up to the insert item? I end up doing a lot things like below:

Is this colouring something that exists parallel to but unaffiliated with the data itself? I ask because there are basically two solutions to this:

  1. Create a panel with two inputs, one which provides the data and another which provides (optional) colour codes.
  2. Store the colour as meta-data onto the values themselves.

I’d prefer to use the second option as that is the go-to solution in GH2, but it does require attaching meta-data to the values, and then possibly stripping it away again later.

Thanks a lot David - Option 2 seems better as otherwise one would need to identify the text as part of the panel which might defeat the point of colouring it in the first place. In that sense, the different colours of point list (by branch) worked very well. Where to allocate this meta-data is the question though, in this case i am using the insert item component. would it be a matter of right clicking on the component and giving the data a colour?

In GH2 there will be a component which allows you to assign meta-data to any value. So you’d have to generate your colours somehow, then run all your values into this component and supply all colours, along with the appropriate meta-data tag which the Panel will understand. Possibly something like "DisplayColour".

1 Like

Quick mockup of how I imagine this would work.

The main problem here is knowing what you need to name these metadata so that the panel interprets it correctly. Somewhere there will need to be a list of predefined names that Grasshopper understands, possible in the form of a categorised Value List object.

1 Like