| Contents | Index |
| On this page… |
|---|
SimMechanics visualization has two formats for specifying a color.
You specify colors by RGB values according to the MATLAB Graphics ColorSpec for
An entire model, in the Visualization area of the SimMechanics node of the Configuration Parameters dialog.
An entire machine, in the Visualization tab of that machine's Machine Environment block dialog.
The RGB (red–green–blue) triple of values is a vector [r g b], with each value separately satisfying 0 ≤ r, g, b ≤ 1.
Red, green, and blue are [1 0 0], [0 1 0], and [0 0 1], respectively.
Black and white are [0 0 0] and [1 1 1], respectively.
Other valid triples specify nonfundamental colors.
You specify colors for individual bodies by visual inspection in the color palette in their respective Body dialogs.
The SimMechanics visualization initial default color for visualized bodies is red (RGB of [1 0 0]).
You can change the initial default to a different default color for all visualized bodies in a model.
Open the Configuration Parameters dialog, then go to the SimMechanics node.
In the Visualization area, change the Default body color RGB vector to a different, valid vector of values.
Click Apply or OK.
Note You can override the model-wide default body color, both for a whole machine and for individual bodies. |
The initial default is for a machine to inherit its model-wide body color. You can override the initial default by specifying a different machine-wide default color for all the bodies in one machine in your model.
Open that machine's Machine Environment block dialog and click its Visualization tab.
In the Body color selection mode pull-down menu, choose Specify. The Default body color field becomes active.
Change the RGB vector to a different, valid vector of values.
Click Apply or OK.
Note You can override the machine-wide default body color for any individual body within the machine. |
The initial default is for a Body to inherit its machine-wide body color. You can override the initial default by specifying a different color for an individual visualized body.
Open the Body block dialog and click its Visualization tab.
In the Body color pull-down menu, choose Use color palette. The color palette button appears.
Click the color palette button. The color palette opens.
Select a color from the palette and click OK.
To save the changes to the Body block and the model, click OK on the Body dialog.
Body Dialog: Visualization Tab and Body Color Palette

![]() | About Custom SimMechanics Visualization | Customizing Visualized Body Geometries | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |