Colour Schemes in Gerber Viewer. Fixed colours for certain layers

Hi,

I would like to know if it would be possible to set some colours as default colours for certain layers. My two particular use cases / personal workflows are:

  1. Inspecting the gerbers, obviously. It’s a bit confusing that every time I open a gerber, its colour seems to be picked at random, so it takes me a while to navigate through the stack of layers.
  2. Visual Diff. I print two sets of gerbers, from different commits, and print all layers from one set of gerbers in one colour (say, cyan) and the other in its complementary (red, in this case), both with some translucency. Matching areas appear white, and the changes are easy to spot.

Is not that I want it to have my way because that’s what I like, I was also thinking that people with colour blindness might struggle with the random colouring too.

As far as I know, python automation is not available in Gerber Viewer, right? Does anyone know, if it’s not available, if it’s planned for 7.0?

1 Like

There are no plans whatsoever for a python API for the gerber viewer. The KiCad project (the developers) wants to keep it viewer only, not an editor, and writing an API for it would spend valuable resources. We have been waiting even for an API for the schematic editor and a totally renewed API for the PCB editor for several years and they have been postponed again and again, so I wouldn’t hold my breath waiting for a gerber viewer API. The situation would be different if some new developer from outside would want to do it.

We will get color schemes for the gerber viewer in v7, i.e. very soon, but I’m not sure it makes the layer assignment totally non-random.

There already is an open issue on gitlab about the layer colors in gerber files. I added a comment for extension to a general color theme to be used for the Gerber viewer too.

I suggest creating a new issue for color scheme handling, if something better than what is in the current nightly builds is needed. Handling the drill markings is a different thing.

I was pretty sure there would be an issue for using the pcb editor layer colors in the gerber viewer because I’m sure it has been discussed before, but I didn’t find any.

I found this closed topic:

It was closed 4 months ago, as a generic color theme is now implemented.
The problem is that the gerber viewer does not know layer names. They are all just numbered layers.

Maybe re-open that one, or create a new one for this?

That’s a problem for gerbers from outside KiCad, but I think KiCad could recognize and to some degree already recognizes gerber layers made by KiCad. The majority of the use cases would be for KiCad generated gerbers anyway.

Yes of course. There is already a function embedded in each gerber file with “FileFunction”, for example:

G04 #@! TF.FileFunction,Copper,L1,Top*

And the (relatively new) Gerber Job file also lists all the files and their “FileFunctions”. I already added a comment to that to the old gitlab issue #10599. Maybe it should be a separate issue.

Thanks for the replies and thanks for the comment in the open ticket, @paulvdh. I’ll leave some comments there.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.