Setting the editor (not Live editor) text and background colors from code
古いコメントを表示
I am trying to make a function that allows me to quickly change the color scheme of my MATLAB editor. I found here:Access and Modify Settings, that I can use the settings groups to change my preferences from code.
I am able to set many of the color settings from code this way:
s = settings;
s.matlab.colors.KeywordColor.TemporaryValue = [0 190 190];
However, I cannot find the text and background color in here:
>> s.matlab.colors
ans =
SettingsGroup 'matlab.colors' with properties:
ValidationSectionColor: [1×1 Setting]
KeywordColor: [1×1 Setting]
CommentColor: [1×1 Setting]
StringColor: [1×1 Setting]
UnterminatedStringColor: [1×1 Setting]
SyntaxErrorColor: [1×1 Setting]
SystemCommandColor: [1×1 Setting]
commandwindow: [1×1 SettingsGroup]
programmingtools: [1×1 SettingsGroup]
>> s.matlab.colors.commandwindow
ans =
SettingsGroup 'matlab.colors.commandwindow' with properties:
HyperlinkColor: [1×1 Setting]
ErrorColor: [1×1 Setting]
WarningColor: [1×1 Setting]
>> s.matlab.colors.programmingtools
ans =
SettingsGroup 'matlab.colors.programmingtools' with properties:
HighlightAutofixes: [1×1 Setting]
VariablesWithSharedScopeColor: [1×1 Setting]
AutomaticallyHighlightVariables: [1×1 Setting]
AutofixHighlightColor: [1×1 Setting]
VariableHighlightColor: [1×1 Setting]
ShowVariablesWithSharedScope: [1×1 Setting]
CodeAnalyzerWarningColor: [1×1 Setting]
What I am looking for are these colors

How can I change these in code?
採用された回答
その他の回答 (1 件)
Rik
2023 年 12 月 12 日
1 投票
You can dig into the code to find the actual field you can use. It might not be documented, but it hasn't changed in years, so you're probably good until Mathworks rolls out the new desktop as the default.
1 件のコメント
Trym Gabrielsen
2023 年 12 月 12 日
編集済み: Trym Gabrielsen
2023 年 12 月 12 日
カテゴリ
ヘルプ センター および File Exchange で System Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!