Skip to content

Coloring Parts and Instances

mkraska edited this page Jul 7, 2026 · 4 revisions

There is a macro paint.py which assigns standard colors to parts. For background and implementation see Claude skill, in German.

  • If the color is assigned to a body in a library file (PartDesign parts), then this sets the standard color for this parts and any instances in assemblies initially have this color.
  • If the color is assigned to a link (part instance) in an assembly, the default color is overridden.

This avoids the need to provide separate library parts for color variants. Each part has a default color, that you can change in the assembly.

As of FreeCAD 1.1.1 this override is stored in the file but not respected upon re-opening of the file. This is fixed in 26.3.0dev. For the time being, the macro refresh_colors.py re-activates the override after loading the file.

grafik

The macro provides a dialog with the following colors:

Materials

Row 1 – Rubber/Plastic

As of July 2026, a unified generic profile is used for all colors: Specular=(0.60,0.60,0.60), Ambient=(0.30,0.30,0.30), Shininess=0.25. Only Diffuse differs per color (see "Known FreeCAD issue" note below for why).

Name Diffuse (R,G,B) Hint
Black (0.228, 0.228, 0.228) Lightened for better edge visibility
Red (1.000, 0.000, 0.000)
Orange (1.000, 0.506, 0.008)
Yellow (1.000, 1.000, 0.000)
Beige (C13) (0.992, 0.729, 0.004) From HTML #fdba01; only occurs in box C13
Blue (0.004, 0.329, 0.635)
Grey (0.678, 0.710, 0.741) Plastic grey
White (1.000, 0.984, 0.941) Slightly off-white

Row 2 – Metal + Standard Reset (Shininess 0.90)

Based on the FreeCAD default material: Diffuse (173,181,189), Ambient (85,85,85), Specular (136,136,136), Shininess=90 (GUI) = 0.90 (internal). The bluish tint is kept, only the brightness is scaled.

Name Diffuse scale Diffuse (R,G,B)
Metal light ×1.30 (0.882, 0.923, 0.964)
Metal medium ×1.00 (0.678, 0.710, 0.741)
Metal dark ×0.65 (0.441, 0.461, 0.482)
Standard ×1.00 same as Metal medium – reset

Clone this wiki locally