MATLAB Help Center
Get available simulink.sampletimecolors.Palette objects
simulink.sampletimecolors.Palette
Since R2024b
simulink.sampletimecolors.getPalette(option)
simulink.sampletimecolors.getPalette('Name'='Value')
simulink.sampletimecolors.getPalette(option) returns one or more simulink.sampletimecolors.Palette objects based on the option specified by option.
option
example
simulink.sampletimecolors.getPalette('Name'='Value') returns a single simulink.sampletimecolors.Palette object with the specified Name property.
Name
collapse all
simulink.sampletimecolors.getPalette
Create a custom color palette object with the name myFirstPalette.
myFirstPalette
pltObj = simulink.sampletimecolors.Palette('myFirstPalette') Palette with properties: Name: "myFirstPalette" ContinuousSampleTimeColors: [0 0 0] FixedInMinorStepSampleTimeColors: [0.4902 0.4902 0.4902] ContinuousVariableSampleTimeColors: [0.4902 0.4902 0.4902] DiscreteSampleTimeColors: [3x3 double] AsynchronousSampleTimeColors: [0.7529 0.3608 0.9843] AperiodicPartitionColors: [0.7529 0.3608 0.9843] InitializeEventSampleTimeColors: [0.7961 0.5176 0.3647] TerminateEventSampleTimeColors: [0.7961 0.5176 0.3647] ResetEventSampleTimeColors: [0.7961 0.5176 0.3647] ReinitializeEventSampleTimeColors: [0.7961 0.5176 0.3647] ConstantSampleTimeColors: [0.8196 0.0157 0.5451] MultirateSampleTimeColors: [0.5451 0.4000 0.0235] UnionSampleTimeColors: [0.4039 0.2980 0.0235]
Customize colors for the discrete sample time and continuous sample time using RGB values.
mypalette.DiscreteSampleTimeColors = [0.9 0.2 0.4]; mypalette.ContinuousSampleTimeColors = [0.7 0.5 0.3]
List all existing palettes using the simulink.sampletimecolors.getPalette function with the 'all' option.
'all'
listOfPalettes = simulink.sampletimecolors.getPalette('all') names = [listOfPalettes.Name]
names = 1×2 cell array {["myFirstPalette"]} {["default (built in)"]}
List the palette that is currently active using the simulink.sampletimecolors.getPalette function with the 'active' option.
'active'
simulink.sampletimecolors.getPalette('active')
ans = Palette with properties: Name: "default (built in)" ContinuousSampleTimeColors: [0 0 0] FixedInMinorStepSampleTimeColors: [0.4902 0.4902 0.4902] ContinuousVariableSampleTimeColors: [0.4902 0.4902 0.4902] DiscreteSampleTimeColors: [3×3 double] AsynchronousSampleTimeColors: [0.7529 0.3608 0.9843] AperiodicPartitionColors: [0.7529 0.3608 0.9843] InitializeEventSampleTimeColors: [0.7961 0.5176 0.3647] TerminateEventSampleTimeColors: [0.7961 0.5176 0.3647] ResetEventSampleTimeColors: [0.7961 0.5176 0.3647] ReinitializeEventSampleTimeColors: [0.7961 0.5176 0.3647] ConstantSampleTimeColors: [0.8196 0.0157 0.5451] MultirateSampleTimeColors: [0.5451 0.4000 0.0235] UnionSampleTimeColors: [0.4039 0.2980 0.0235]
Apply the new custom palette to the current MATLAB® session.
simulink.sampletimecolors.applyPalette('myFirstPalette')
'UserDefault'
simulink.sampletimecolors.Palette object or objects to get, specified as 'all', 'active', or 'UserDefault'.
all – Get a list of all the palette objects available.
all
active – Get the currently active palette object.
active
UserDefault – Get the palette object that is set as a default palette in preferences.
UserDefault
Name property the simulink.sampletimecolors.Palette object that you want to return, specified as a string or a character vector.
Example: simulink.sampletimecolors.getPalette('Name'='myFirstPalette')
simulink.sampletimecolors.getPalette('Name'='myFirstPalette')
Introduced in R2024b
simulink.sampletimecolors.Palette | simulink.sampletimecolors.applyPalette | simulink.sampletimecolors.removePalette | simulink.sampletimecolors.storePalette
simulink.sampletimecolors.applyPalette
simulink.sampletimecolors.removePalette
simulink.sampletimecolors.storePalette
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office