Skip to content

DRAW-42 Touching items too close in colour

Severity Status Implementation
suggestion runs in better_erc mid, depends on NET-26

Data it needs: drawing geometry, colour theme.

Looks at. The schematic drawing, the project's net class colours, the colour theme.

Rule: neighbours in different colours. For each touching pair (a wire end on a pin, a wire on a power symbol's pin, a label on its wire), the effective colours (the item's own, else its net class colour, else the theme's) on the light and the dark theme, and their CIEDE2000 difference; below drawing.colour.pair_min (default 20) is a finding, reported per sheet and per theme, once per colour pair with a place count. A power symbol's colour is its library stroke colour, else the theme's component_outline.

Scope. The themes are not in the project: give KiCad's colors/*.json with a repeatable berc check --theme PATH. Without one the check is reported as not run (need colour-theme). A label taking its net class colour is left out: KiCad draws it in its wire's class colour, so that pair is always ΔE 0 and only a hand-set colour would part them, which DRAW-27 advises against.

Settings

Set them in the project file under [checks."DRAW-42"], or for one run with --set DRAW-42.NAME=VALUE. A name that starts with drawing. is shared by several checks and is set under that name alone.

Setting Default Meaning
drawing.colour.pair_min 20 CIEDE2000 least difference between touching items

Test schematics

Each schematic below is in test_schematics/sources. The block under it is what berc check --only DRAW-42 reports on it.

draw-42_touching_colours

The test schematic draw-42_touching_colours The test schematic draw-42_touching_colours

  suggestion DRAW-42 #p3b   on Test theme, wires rgb(0, 0, 180) and labels rgb(0, 0, 194) differ by ΔE 1.8, below 20, at 2 places, first label BLUE at x 111.76 y 40.64
                            sheet /, item Test theme: label rgb(0, 0, 194), item Test theme: wire rgb(0, 0, 180)
                            fix: change the theme, the net class or the library symbol, not the item
  suggestion DRAW-42 #ggr   on Test theme, wires rgb(150, 110, 10) and pins rgb(150, 108, 0) differ by ΔE 0.9, below 20, at 1 place, first R1.1 pin at x 60.96 y 45.72
                            sheet /, item Test theme: pin rgb(150, 108, 0), item Test theme: wire rgb(150, 110, 10)
                            fix: change the theme, the net class or the library symbol, not the item
  suggestion DRAW-42 #v70   on Test theme, wires rgb(50, 165, 30) and power symbols rgb(60, 170, 24) differ by ΔE 1.9, below 20, at 1 place, first power GND at x 86.36 y 60.96
                            sheet /, item Test theme: power symbol rgb(60, 170, 24), item Test theme: wire rgb(50, 165, 30)
                            fix: change the theme, the net class or the library symbol, not the item