Showcase Fridays
26th February 2025

Bring Some Colour to Your Grasshopper Scripts

Continuing the point of consistency and templating scripts. Let’s look at how to make colouring your groups less painful in Grasshopper. There are two ways to do this, one through a programming node like C# or one through metahopper.

Why bother colouring ?

In case, you missed the last issue, my templates have applies a consistent colour to all my scripts. Colouring your groups is less about making things neat and tidy (even though that is nice too) but more about making your scripts feel consistent. If you can come up with a set of colours that represent the different operations like visualisation, input, output, etc… you can make all your scripts look and feel the same.

This consistency guides people through your script and shows them what to expect. It also means they can look for things quicker because colours are easier to recognize than a bunch of wires and components. Take my template for example, it’s minimal but it has consistent colours through all my scripts.

Then if you take a look at a large script with the template applied. You can immediately tell just based on the colours which components are the inputs and outputs. You may not understand the script, but you at least know what to look for. At the end of the day, it’s about leaving your script in a way that makes it easier for someone else to understand without your help.

Let’s talk specifics about how this works.

For both ways (C# and Metahopper) they work off the group nicknames. You assign a colour to a nickname, say “_INPUT” and then any group with the nickname “_INPUT” will get assigned that colour

0:00
/0:13

Metahopper Auto Colouring

With a list of group names, colours and a few metahopper components, you can create a a workflow that updates the colours.

You just have to match the right group name with the right colour. And, when you have named your groups, clicking on the button will update the colours.

C# Auto Colouring

If you’re working in a team, I strongly recommend the C# way because it’s one less plugin that others have to install. This is a modified C# components that was originally written by Mathias Sønderskov Schaltz sometime in 2022.

For the most part, it doesn’t require any editing. All you have to do is plug in your colours with their group names in the swatches.

It takes up way less space than the MetaHopper way and it will run automatically, no need to click the update button.


I hope that was helpful and has inspired you to template your own scripts. Next week, I’ll talk about one more thing about templating and then we’ll move on.

Happy scripting!

Braden.