Skip to Main Content Skip to Search
Product Documentation

Customizing Visualized Body Colors

Choosing Custom Body Colors

SimMechanics visualization has two formats for specifying a color.

MATLAB ColorSpec Vector

You specify colors by RGB values according to the MATLAB Graphics ColorSpec for

The RGB (red–green–blue) triple of values is a vector [r g b], with each value separately satisfying 0 ≤ r, g, b ≤ 1.

Color Palette Interface

You specify colors for individual bodies by visual inspection in the color palette in their respective Body dialogs.

Switching Between Default and Custom Body Colors

The SimMechanics visualization initial default color for visualized bodies is red (RGB of [1 0 0]).

Changing the Default Color for All Bodies in a Model

You can change the initial default to a different default color for all visualized bodies in a model.

  1. Open the Configuration Parameters dialog, then go to the SimMechanics node.

  2. In the Visualization area, change the Default body color RGB vector to a different, valid vector of values.

  3. Click Apply or OK.

Changing the Default Color for All Bodies in a Machine

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.

  1. Open that machine's Machine Environment block dialog and click its Visualization tab.

  2. In the Body color selection mode pull-down menu, choose Specify. The Default body color field becomes active.

  3. Change the RGB vector to a different, valid vector of values.

  4. Click Apply or OK.

Changing the Color of an Individual Body

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.

  1. Open the Body block dialog and click its Visualization tab.

  2. In the Body color pull-down menu, choose Use color palette. The color palette button appears.

  3. Click the color palette button. The color palette opens.

  4. Select a color from the palette and click OK.

  5. 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

  


Related Products & Applications

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