Pcb_new Layout change background color


#1

how can i change the black background of pcb_new to any other light color… as it is irritating…


Designing high current traces with vias
#2

Short answer: not yet. There was a thread two weeks ago on this topic.


#3

That’s a popular question but in current version (4.0.6) there is no way to change it.

A change was committed just recently so the next kiCad version (ver 5) should have it. This patch should be in nightly versions, can any nightly users confirm?

https://bugs.launchpad.net/kicad/+bug/1530543


#4

The commit is there, but I can’t find a way in the GUI to change the background color in my latest nightly… can you @bobc ?


#5

Don’t know, the windows builds are broken, a Linux user might know. I would expect it to appear on the Layer side panel, after Values and References along with some other new layers.

     RR( _( "Values" ),          LAYER_MOD_VALUES,     COLOR4D::UNSPECIFIED, _( "Show footprint's values") ),
     RR( _( "References" ),      LAYER_MOD_REFERENCES, COLOR4D::UNSPECIFIED, _( "Show footprint's references") ),
+    RR( _( "Worksheet" ),       LAYER_WORKSHEET,      DARKRED,              _( "Show worksheet") ),
+    RR( _( "Cursor" ),          LAYER_CURSOR,         WHITE,                _( "PCB Cursor" ), true, false ),
+    RR( _( "Aux items" ),       LAYER_AUX_ITEMS,      WHITE,                _( "Auxillary items (rulers, assistants, axes, etc.)" ), true, false ),
+    RR( _( "Background" ),      LAYER_PCB_BACKGROUND, BLACK,                _( "PCB Background" ), true, false )

#6

Yeah, there it is. I was looking in the preferences.

It looks like this.


I kind of prefer the old black


#7

I also had to change to OpenGL mode, in addition to the menu option.


#8

I tried it some days ago but it changed only between black and white. Black is much more eye friendly, and the same color scheme isn’t necessarily good for both backrounds. What I would like to have is a couple of good predefined color schemes for different situations. Is it possible to share color schemes as python scripts?


#9

I would love to see themes or saved profiles available. Editing text files is a bit of an annoyance, and being able to have a few sensible default themes(ie Kicad Light Standard, Solarized etc) or easily copyable theme files would be nice. But this is left up to the devs and there are certainly more important things to work on…


#10

I’m trying to create something like LayerViewSet for colors, but I can’t find access to the colors from Python. The best I can do is find the color index into g_ColorRefs for each layer.

b=pcbnew.GetBoard() # returns BOARD
cds=b.GetColorSettings() # Returns COLORS_DESIGN_SETTINGS
for i in range(pcbnew.LAYER_ID_COUNT):
    print i, b.GetLayerName(i), cds.GetLayerColor(i)

0 F.Cu 15
1 In1.Cu 23
2 In2.Cu 22
3 In3.Cu 21
4 In4.Cu 14
5 In5.Cu 13
6 In6.Cu 12
7 In7.Cu 2
8 In8.Cu 16
9 In9.Cu 3
10 In10.Cu 16
11 In11.Cu 15
12 In12.Cu 17
13 In13.Cu 3
14 In14.Cu 12
15 In15.Cu 13
16 In16.Cu 15
17 In17.Cu 23
18 In18.Cu 22
19 In19.Cu 21
20 In20.Cu 14
21 In21.Cu 13
22 In22.Cu 12
23 In23.Cu 2
24 In24.Cu 16
25 In25.Cu 3
26 In26.Cu 16
27 In27.Cu 15
28 In28.Cu 17
29 In29.Cu 3
30 In30.Cu 12
31 B.Cu 13
32 B.Adhes 12
33 F.Adhes 16
34 B.Paste 20
35 F.Paste 15
36 B.SilkS 16
37 F.SilkS 14
38 B.Mask 17
39 F.Mask 16
40 Dwgs.User 3
41 Cmts.User 12
42 Eco1.User 13
43 Eco2.User 23
44 Edge.Cuts 23
45 Margin 22
46 B.CrtYd 23
47 F.CrtYd 2
48 B.Fab 15
49 F.Fab 23

EDA_COLOR_T  is an enum

enum EDA_COLOR_T
{
    UNSPECIFIED_COLOR = -1,
    BLACK = 0,
    DARKDARKGRAY,
    .
    .
    .
    PUREYELLOW,
    NBCOLORS,                    ///< Number of colors
    HIGHLIGHT_FLAG =  ( 1<<19 ),
    MASKCOLOR      =    31       ///< mask for color index into g_ColorRefs[]
}    

EDA_COLOR_T base = static_cast<EDA_COLOR_T>( aColor & MASKCOLOR );
extern const StructColors g_ColorRefs[NBCOLORS];

I have failed at various attempts to get the actual color information from g_ColorRefs array.

>>> pcbnew.g_ColorRefs[0]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: 'StructColors' object does not support indexing
>>> pcbnew.g_ColorRefs
<pcbnew.StructColors; proxy of <Swig Object of type 'StructColors *' at 0x00000000060dbc00> >
>>> sc= pcbnew.g_ColorRefs
>>> sc.m_Blue
0
>>> sc
<pcbnew.StructColors; proxy of <Swig Object of type 'StructColors *' at 0x00000000060dbc00> >
>>> sc.m_Numcolor
0
>>> sc.__dict__
{'this': <Swig Object of type 'StructColors *' at 0x00000000060dbc00>}
>>> sc.this
<Swig Object of type 'StructColors *' at 0x00000000060dbc00>
>>> sc.m_ColorName
<Swig Object of type 'wxChar *' at 0x000000000656dfc0>
>>> sc.m_ColorName.__str__
<method-wrapper '__str__' of SwigPyObject object at 0x000000000656dc90>
>>> sc.m_ColorName.__str__()
"<Swig Object of type 'wxChar *' at 0x0000000006549c90>"
>>> pcbnew.g_ColorRefs+1
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'StructColors' and 'int'
>>> dir(pcbnew.g_ColorRefs)
['__class__', '__del__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__swig_destroy__', '__swig_getmethods__', '__swig_setmethods__', '__weakref__', 'm_Blue', 'm_ColorName', 'm_Green', 'm_LightColor', 'm_Numcolor', 'm_Red', 'this']
>>> pcbnew.g_ColorRefs.__sizeof__()
32