# pcb-rnd User Manual: Appendix

## 9.4 Layer colors

Each layer has its own layer color. Starting with lihata board v5, the layer color is saved to and loaded from board files. Layers retain their color even when they are moved within or between layer groups.

In parallel to this mechanism, there is a set of default colors defined in the conf subsystem: a set of default copper layer colors and specific default colors for paste, mask and silk layers.

There are only two cases when the default colors from the config subsystem are used:

- When a new layer is created or a layer without color specified is loaded from a file or when a layer is loaded from a file format that does not support per layer color, a default color is assigned from the config, depending on the layer type.
- When an object needs to be displayed out of the board, e.g. in the footprint preview window of the library dialog

Composite rendering: positive layers are always rendered using their own layer color (e.g. it is possible to define two silk layers in the top silk group with two different colors, and the silk drawing on screen will have two colors). A negative layer's color is normally invisible, thus does not matter, because objects of a negative layer are removing pixels, not drawing them.

When a composite layer group is rendered with the first layer being negative (typical for mask), the rendering code needs to apply a fill that covers the whole board, so the negative layer objects can cut out from that fill. The color of this fill is the color of the first layer.

Limitation: per board per layer custom color is supported by pcb-rnd but is not supported by many of the other PCB editors and file formats. Thus saving the board to an alien format (or to a lihata board version v4 or lower), the layer color info is lost. There is no explicit warning is generated about this.