User-defined netclass colours

Bug #1530637 reported by Artsiom Shchatsko on 2016-01-03
This bug affects 19 people
Affects Status Importance Assigned to Milestone

Bug Description

It would be very handy to be able to assign a color to a net in layout.

xzcvczx (xzcvczx) on 2016-01-03
Changed in kicad:
importance: Undecided → Wishlist
tags: removed: wishlist
Tomasz Wlostowski (twlostow) wrote :

To a net in ratsnest, to routed tracks/vias or both?


Artsiom Shchatsko (cioma) wrote :

To routed tracks, vias and footprint pads

Tomasz Wlostowski (twlostow) wrote :

How to distinguish between user-assigned net colors and layer colors then?

Artsiom Shchatsko (cioma) wrote :

Net color is a property of a net and layer color is a property of a layer. Net color has a higher priority than a layer color (i.e. if a net has a color assigned then layer color is ignored and all elements of the net are shown in the assigned color).

Artsiom Shchatsko (cioma) wrote :

I quickly took a look in kicad_pcb file and it seems layer colors are not stored there. If that's the case then implementing discussed functionality might require extending kicad_pcb file format and I'd understand if developers would be reluctant to do that.

I would prefer highlighting all of the tracks, vias, and footprint pads
of a net rather than a user defined colors. Would that be acceptable?
I would most likely be just as effective and easier to implement. I
would also prefer different colors for the ratsnest which is really
helpful when routing a board.

On 1/3/2016 11:58 AM, Artsiom Shchatsko wrote:
> To routed tracks, vias and footprint pads

Well, as I understand, net highlighting is already implemented (Ctrl+LMB click on a net) which is useful but doesn't address the following scenario:

A complex IC has ten power supply rails. I need to place decoupling capacitors on all of them, break-out and route power nets. While doing that I might need to compromise on some decoupling capacitors, power or ground vias etc. If I could assign colors to nets it would be way easier to perform that task.

Other scenarios like coloring DDR3 memory data, control/address and clock nets are valid too.

In the end of the day I think what I actually need is an easy way to visually identify nets in layout. Color seems to be the obvious way to do that but perhaps people can suggest other ways.

Nick Østergaard (nickoe) wrote :

FYI Jeppe Johansen already made a patch to support netclass coloring, which you can then switch to when routing your DDR3 memory. You should seriously give that a look and try.

Nick Østergaard (nickoe) wrote :

You enable it on the new bottommost icon on the left toolbar. The icons is currently the same image as high contrast mode display button.

Jeppe Johansen (jeppe-i) wrote :

Some pictures of the above patch.

Netclass coloring:
Netclass color+high intensity:
Configuration of colors done through netclass setup:

Maciej Suminski (orsonmmz) wrote :

With the current HEAD, after applying the attached patch it is required to regenerate code for DIALOG_DESIGN_RULES_BASE class with wxFormBuilder.

There are minor code formatting issues (spaces between brackets and parameters in function calls, NetClassColorRenderer -> NETCLASS_COLOR_RENDERER). It would be great if there was a new toolbar icon for the new feature, though I do not see it as a requirement now. The biggest obstacle is, it changes the .kicad_pcb file format, but I realize the net color settings have to be saved in the same file. We need Wayne's opinion here.

Why to save an user preference (a color setting) in the .kicad_pcb file?
It can be also saved in the project config file.

Artsiom Shchatsko (cioma) wrote :

I agree with Jean-Pierre, project config file seems to be a way better place to keep colors.
This would allow implementing both netclass coloring and separate net coloring without changing .kicad_pcb file format.
I'd suggest the following color priority (from lowest to highest): layer, netclass, net.
By the way, would it make sense to keep layer colors in project config file too?

Having just a netclass coloring is a good step forward but it doesn't fully replace separate net coloring. E.g. like in Jeppe's screenshot ( one would need to assign a separate netclass per net just to have it colored differently that all other nets which kind of breaks the netclass idea (i.e. same physical constraints for a set of nets).

I understand that implementing net coloring might not be the top priority so I suppose merging Jeppe's patch into the mainline would be a great improvement already.

Artsiom Shchatsko (cioma) wrote :

I mean merging Jeppe's patch after it's decided where colors shall be kept and the patch is adjusted accordingly.

I personally don't like the changes to the net class edit tab in the
design rules dialog. Colors are not design rules. They have no impact
on the board design. In this case colors are merely a per project user
preference. Setting the net and/or net class colors should happen in
either a third tab in the layer manager, a second tab in the color
dialog or some other place.

On 1/4/2016 11:53 AM, Artsiom Shchatsko wrote:
> I mean merging Jeppe's patch after it's decided where colors shall be
> kept and the patch is adjusted accordingly.

Sam (samuelchinnery) on 2016-02-16
Changed in kicad:
status: New → Incomplete
status: Incomplete → New
Jeff Young (jeyjey) on 2018-04-05
Changed in kicad:
status: New → Triaged
Jeff Young (jeyjey) on 2018-05-20
summary: - Wishlist: assign a color to a net in layout
+ User-defined netclass colours
Robert (robee) wrote :

Sorry for the newbie question, but it looks like someone has already written significant code for this and it was proposed to merge that code with Kicad 2 years ago, but looking at 5.0 rc2, I don't see any evidence of it being implemented. This feature is really handy, has anyone adopted the merging task? Has this already been done and I'm too dim to find it? I'm unfamiliar with patch files, but I imagine the patch is for a much older version of the code and wouldn't work with current versions, but perhaps the original author could produce a new patch?


Maciej Suminski (orsonmmz) wrote :


Unfortunately, the patch had not exactly matched the projects plan and noone had time to fix it, so for the time being colored nets are not available. I agree it is a very useful feature, so there is a high chance we will implement it in v6.

Changed in kicad:
milestone: none → 6.0.0-rc1
Nicholas Dietz (poleguy) wrote :

Me too!

Iain Robertson (iain46) wrote :

Me too! I'd find it really useful if I could assign colours to nets (I think traces, vias, and pads of a particular net) during layout.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers