I’ve been doing some research on the KiCad color palette which seems pretty bland to me. I’ve found the designations in colors.cpp, and can’t find where NBCOLORS is defined. Anybody got a roadmap to it?


It is an enum for the “number of colors”. It is equal to 30 at the moment. Defined in colors.h, line 75


Hmmm. I found that first but I’m not familiar with the definition of enum types. I was expecting a constants somewhere else.

I’ve just read the notes that it’s being migrated to Color4D. I use a variety of CAD/CAE programs all with different color schemes and entity/layer options. I’ve been researching different color selections depending upon output type (ie printed CMYK or displayed RGB). They each have a range of colors that wash out, are more/less distinguishable, or are similar enough that can be used for either output.

Can you point me in a direction of what files to look at for the newer 4D color definitions?

Cheersies :wink:


Easiest way to think through that (visually) is to set a layer color and then open the pcbnew preferences file.

You’ll see a bunch of lines like:

Color4DPCBLayer_F.Cu=rgba(141, 43, 31, 0.620)
Color4DPCBLayer_In1.Cu=rgba(194, 194, 0, 0.678)
Color4DPCBLayer_In2.Cu=rgba(163, 71, 194, 0.678)

The first three numbers are 0-255 for RGB. The third number is 0.0-1.0 for the alpha channel


Hmmm…okaaayy. I’m running an older version on XP right now. I’ve got a windows 7 machine I rarely use. I’m guessing from the context that the vision is to move away from a fixed palette of colors, and allow a color range stored in configuration files. I’ll have to load a recent build and check it out.



Finally had a chance to look at a new version 5.0.2.

I like the 4color picker. Figured that’s what the code was all about. Nice work.

One suggestion: Hot Keys for selecting fields to enter color values (ie Alt-R Alt-G Atl-B Alt-H Alt-S Alt-V)

A few questions:

Are you part of the UI/Graphics development team? I assume so, but if not can you point me to someone who is?

I understand where the default colors/values are defined, and their eventual migration into the color picker group. I suppose my fundamental question is: What functions/headers/modules contain the code that assigns the colors from the default palette, to the layers in the schematic or pcb editor?

I’ve looked at the default palette and layer color assignments as part of my “research” and found some interesting ideas that might be worth incorporating. I need to find/read those functions/headers/modules to get a better idea of the mods.



Are you sure the USER forum is the right place for this? Might this be better suited for the mailing list? (I assume you plan to contribute something to kicad. Devs communicate such things via the mailing list.)


?? Contribute ?? Hmmm…That would be a first. Nobody’s ever thought I had brains enough for that!!! LOL!!!

I suppose that would be the general idea…I’m just trying to figure out some basics and don’t want to get in the way of all those probably really busy people with more serious problems like bugs n’ stuff.

I take it from your question, I should probably just do that (?)

Thanks Rene.


Hi @KiCadCpmb As Rene says, you should join the dev mailing list and ask your code-related question there. People who are too busy will simply wait to answer you until they have time, so it’s no skin off anyone’s nose.

Suggestions for future KiCad improvements should go on the bug tracker (https://bugs.launchpad.net/kicad). They’ll be marked wishlist and maybe someone will get around to them if they agree with you. Or you could just assign yourself and add a patch to the report.


Probably just bug it and send the code when I get around to it :wink: