MATLAB syntax highlighting color settings
You can customize the colors for syntax highlighting using the
matlab.colors
settings. Access matlab.colors
settings using the root SettingsGroup
object returned by the
settings
function. For example, set the temporary value for the
color of comments to [173 235 255]
(light blue).
s = settings; s.matlab.colors.CommentColor.TemporaryValue = [173 235 255]
For more information about settings, see Access and Modify Settings.
SyntaxErrorColor
— Color of syntax errors[255 0 0]
(default) | RGB tripletColor of syntax errors, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.SyntaxErrorColor.TemporaryValue = [173
235 255]
KeywordColor
— Color of keywords[14 0 255]
(default) | RGB tripletColor of keywords, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.KeywordColor.TemporaryValue = [173 235
255]
StringColor
— Color of strings[170 4 249]
(default) | RGB tripletColor of strings, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.StringColor.TemporaryValue = [173 235
255]
SystemCommandColor
— Color of system commands[178 140 0]
(default) | RGB tripletColor of system commands, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.SystemCommandColor.TemporaryValue = [173
235 255]
UnterminatedStringColor
— Color of unterminated strings[196 0 0]
(default) | RGB tripletColor of unterminated strings, specified as an RGB triplet with values in the range [0,255].
Example: s.matlab.colors.UnterminatedStringColor.TemporaryValue =
[173 235 255]
CommentColor
— Color of comments[2 128 9]
(default) | RGB tripletColor of comments, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.CommentColor.TemporaryValue = [173 235
255]
ValidationSectionColor
— Color of validation sections[160 82 45]
(default) | RGB tripletColor of validation sections, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.ValidationSectionColor.TemporaryValue =
[173 235 255]
ErrorColor
— Color of Command Window errors[230 0 0]
(default) | RGB tripletColor of Command Window errors, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.commandwindow.ErrorColor.TemporaryValue =
[255 0 0]
WarningColor
— Color of Command Window warnings[255 100 0]
(default) | RGB tripletColor of Command Window warnings, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.commandwindow.WarningColor.TemporaryValue
= [0 0 255]
HyperlinkColor
— Color of Command Window hyperlinks[0 0 255]
(default) | RGB tripletColor of Command Window hyperlinks, specified as a RGB triplet with values in the range [0,255].
Example: s.matlab.colors.commandwindow.HyperlinkColor.TemporaryValue
= [173 235 255]
CodeAnalyzerWarningColor
— Color of Code Analyzer warnings[255 148 0]
(default) | RGB tripletColor of Code Analyzer warnings, specified as a RGB triplet with values in the range [0,255].
For more information about the Code Analyzer, see Automatically Check Code in the Editor and Live Editor — Code Analyzer.
Example: s.matlab.colors.programmingtools.CodeAnalyzerWarningColor.TemporaryValue
= [0 255 0]
HighlightAutofixes
— Highlight Code Analyzer autofixes1
(default) | 0
Highlight Code Analyzer autofixes, specified as 1
or
0
.
Set to 1
to highlight code in the Editor and Live
Editor for which there is an automatic fix.
For more information about the Code Analyzer, see Automatically Check Code in the Editor and Live Editor — Code Analyzer.
Example: s.matlab.colors.programmingtools.HighlightAutofixes.TemporaryValue
= 0
AutofixHighlightColor
— Color of Code Analyzer autofix highlight[238 225 180]
(default) | RGB tripletColor of Code Analyzer autofix highlight, specified as a RGB triplet with values in the range [0,255].
HighlightAutofixes
must be set to 1
to see the change in the autofix highlight.
Example: s.matlab.colors.programmingtools.AutofixHighlightColor.TemporaryValue
= [0 255 0]
AutomaticallyHighlightVariables
— Automatically highlight variables and functions1
(default) | 0
Automatically highlight variables and functions, specified as
1
or 0
.
Set to 1
to highlight all occurrences of a specific
variable or function in the Editor and Live Editor.
For more information about using automatic highlighting to find and replace functions or variables in the current file, see Find and Replace Text in Files.
Example: s.matlab.colors.programmingtools.AutomaticallyHighlightVariables.TemporaryValue
= 0
VariableHighlightColor
— Color of variable and function highlight[202 232 232]
(default) | RGB tripletColor of variable and function highlight, specified as a RGB triplet with values in the range [0,255].
AutomaticallyHighlightVariables
must be set to
1
to see the change in the variable and function
highlight.
Example: s.matlab.colors.programmingtools.VariableHighlightColor.TemporaryValue
= [255 232 0]
ShowVariablesWithSharedScope
— Show variables with shared scope1
(default) | 0
Show variables with shared scope, specified as 1
or
0
.
Set to 1
to show variables with shared scope using a
specific color.
For more information about displaying variables with shared scope, see Check Variable Scope in Editor.
Example: s.matlab.colors.programmingtools.ShowVariablesWithSharedScope.TemporaryValue
= 0
VariablesWithSharedScopeColor
— Color of shared scope variables[0 163 163]
(default) | RGB tripletColor of shared scope variables, specified as a RGB triplet with values in the range [0,255]. The text is colored, not shaded.
ShowVariablesWithSharedScope
must be set to
1
to see the change in the color of shared scope
variables.
Example: s.matlab.colors.programmingtools.VariablesWithSharedScopeColor.TemporaryValue
= [173 235 255]