Using Simulink | ![]() ![]() |
Specifying Colors Programmatically
You can use the set_param
command at the MATLAB command line or in an M-file program to set parameters that determine the background color of a diagram and the background color and foreground color of diagram elements. The following table summarizes the parameters that control block diagram colors.
Parameter |
Determines |
ScreenColor |
Background color of block diagram |
BackgroundColor |
Background color of blocks and annotations |
ForegroundColor |
Foreground color of blocks and annotations |
You can set these parameters to any of the following values:
'black'
, 'white'
, 'red'
, 'green'
, 'blue'
, 'cyan'
, 'magenta'
, 'yellow'
, 'gray'
, 'lightBlue'
, 'orange'
, 'darkGreen'
'[r,g,b]'
r
, g
, and b
are the red, green, and blue components of the color normalized to the range 0.0
to 1.0
.
For example, the following command sets the background color of the currently selected system or subsystem to a light green color:
![]() | Defining a Custom Color | Enabling Sample Time Colors | ![]() |