OpenSCAD User Manual/First Steps/Changing the colour of an object

RGBの値を指定し、オブジェクトの色を変更することが可能。 値は0から255という一般的な指定ではなく、0.0から1.0という方法により行う。

color([1,0,0]) cube([2,3,4]);
translate([3,0,0])
color([0,1,0]) cube([2,3,4]);
translate([6,0,0])
color([0,0,1]) cube([2,3,4]);
OpenSCAD changing the color of an object

2011.12からカラーネームの使用が可能である。カラーネームはWeb colorsのものが使用できる。

使用例:color("red") cube();

色指定はF5のプレビューモードのみであり、F6のレンダリングでは実行されない。