[![MATLAB FileExchange](https://img.shields.io/badge/MATLAB-FileExchange-orange.svg)][fex]
MATLAB Schemer
==============
This MATLAB package makes it easy to change the color scheme (a.k.a. theme) of
the MATLAB display and GUI.
You can use Schemer to import a predefined color scheme, transfer your color
settings between installations, or create your own color scheme.
A collection of color schemes is available in the schemes folder.
Samples of these can be seen in [schemes/README.md](schemes/README.md),
and browsed in the folder [schemes/screenshots](schemes/screenshots).
This is a static subtree copy of the contents of the repository
[matlab-schemes].
![MATLAB Schemer logo](logo.png)
Importing a color scheme
------------------------
Color schemes can be easily imported by running `schemer_import` at the MATLAB
command prompt, without needing any inputs. This will open a GUI to select the
file to import the color scheme from.
When importing a color scheme, most of the settings will change immediately.
However, some settings will require MATLAB to be restarted:
- Variable highlighting colours
- Wavy underlines for errors
- Wavy underlines for warnings
For more details, see the documentation on the function `schemer_import`,
available with `help schemer_import`.
Transferring a color scheme between MATLAB installations
--------------------------------------------------------
If you are using a personalised color scheme in MATLAB, you may wish to save
it for yourself so you can re-implement it easily if you reintall MATLAB.
Or you may wish to transfer your personalised color scheme from one machine
to another. This section describes the steps relevant in either scenario.
On the source machine, run `schemer_export` to save a temporary color scheme
file, and then transfer this file to the destination machine.
When importing the new color scheme, instead of running `schemer_import` without
any inputs, you should run `schemer_import(true)`. This passes a flag to tell
the function to not only import the colour preferences, but to also import your
boolean settings (such as whether to highlight the current cell/line, etc)
from the file you exported from the source installation.
Reverting to the MATLAB default color scheme
--------------------------------------------
Should you wish to revert to the set of colours which MATLAB ships with, you
should run `schemer_import('schemes/default.prf')`.
This will import the MATLAB default theme from the stylesheet `default.prf`
which comes as part of Schemer.
To restore the out-of-the-box state for boolean settings (such as whether to
highlight the current line) in addition to the colours, run
`schemer_import('schemes/default.prf', true)`.
You may be tempted to instead revert the colours by clicking the
`Restore Default Colors` buttons in the `Color` pane of the MATLAB preferences.
However, this will be less effective than importing the default colours through
Schemer because these buttons will not reset all the MATLAB colour preferences.
(There is no reset button for the Editor display preferences pane, nor for the
other language syntax supported by MATLAB, which is available in the Editor
Languages panel.)
Creating a color scheme for others to use
-----------------------------------------
When creating a color scheme to share with the rest of the world, it is
recommended to ensure colours are chosen appropriately for all possible
settings, even if they are not enabled.
For example, if you are creating a dark colour scheme, you may have cell
highlighting disabled but it would still be ill-advised to leave the background
highlight colour for cell displays as the default pale beige because other users
may have this setting enabled.
### Exporting through the GUI
If you have made a custom color scheme using the MATLAB GUI to pick the colours,
you can export the new color scheme with `schemer_export`.
Please note, this requires you to have visited all relevant panes of the
Preferences window at least once since MATLAB was installed, even if the
settings have not been changed from the default.
See the help for `schemer_export` for more details.
### Porting a theme from a different editor
If you are converting a color scheme designed for another editor into a MATLAB
stylesheet, you may find it easier to start with a duplicate of the template
stylesheet [develop/template_scheme.prf](develop/template_scheme.prf) and copy
the colours into this.
To understand which colour settings the parameter names correspond to, you can
refer to the annotated screenshot,
[develop/annotated_default.png](develop/annotated_default.png).
![Annotated screenshot](develop/annotated_default.png)
The values for each colour in the .prf stylesheet must be recorded as single
RGB integers, with each colour channel in 8-bit (0-255), R as big endian,
and a opaque alpha channel. Because the format for RGB colours in Java allows
for an alpha channel and the integers are signed, all the colours you record
in your .prf file should be negative, spanning the range
`-16777216` (black, `[0,0,0]`) to `-1` (white, `[255,255,255]`).
The text file for your pre-existing theme will typically specify its colous in
hexadecimal format, or in terms of R, G, B values. You will need
to convert the colours from this format into the format which MATLAB preference
files use to specify colours instead.
The Schemer package comes with a utility function
[develop/color2javaRGBint.m](develop/color2javaRGBint.m)
to help make this easier. See the `color2javaRGBint` documentation for more
details.
### Setting colours for additional languages
MATLAB supports syntax highlighting for several languanges in addition to its own.
Currently these languages are
MuPAD, TLC, VRML, C/C++, Java, VHDL, Verilog, and XML/HTML.
The colours used for the syntax highlighting of all these languages can be set
in the Languages subpanel of the Editor/Debugger pane in the Preferences window.
Typically, one will want to make a color scheme which has colours in these
languages which match the colours of the analogous MATLAB syntax.
By default, this is the behaviour which Schemer will perform.
Without specifying any inputs to `schemer_export`, an exported color scheme file
will contain only the colours used for MATLAB syntax highlighting and no other
languages, since it is expected that users will typically not set the colours
for any of these languages. When this is loaded with `schemer_import`, the missing
colours for additional languages are automatically completed based on the MATLAB
syntax.
If you do customise the colours for the additional language syntax highlighting,
you can export this by setting an appropriate flag, such as `schemer_export(3)`.
For more details, see the `schemer_export` documentation.
If you are designing a color scheme and are very detail-oriented, you may like to
do the following.
1. Configure the colours for the MATLAB syntax first in the Preferences > Colors
panel and Programming Tools subpanel, along with Editor/Debugger > Display
preference pane for the Current line highlighting and Right-hand text limit.
2. Export the colorscheme with `schemer_export('tmp.prf',1)`, excluding additional
language syntax from the export.
3. Load the colorscheme with `schemer_import('tmp.prf')`, which overwrites the
syntax for the additional languages with automatically inferred colours.
4. Open up the panel Preferences > Editor/Debugger > Languages and inspect the
quality of the colorscheme in the addition languages.
5. Fix or improve any perceived issues with the colorscheme in the Languages panel.
6. Export the colorscheme again, but this time with `schemer_export(3)` to include
the customised colours for the additional languages.
### Adding your scheme to this package
If you are particularly proud of your new color scheme (and why wouldn't you be)
and would like to to share it with the world as part of the `matlab-schemer`
package, th
没有合适的资源?快使用搜索试试~ 我知道了~
在 MATLAB 中轻松应用和保存配色方案
共52个文件
png:13个
prf:12个
m:6个
需积分: 5 0 下载量 71 浏览量
2024-05-17
16:05:14
上传
评论
收藏 516KB ZIP 举报
温馨提示
在MATLAB中轻松应用和保存配色方案可以帮助用户创建具有吸引力和可读性的图形,并提高数据可视化的效果。以下是有关如何在MATLAB中实现这一目标的资源描述: 配色方案应用: 1. **内置配色方案**:MATLAB提供了多种内置的配色方案,用户可以通过简单的命令或图形界面轻松地应用这些配色方案到他们的图形中。 2. **自定义配色方案**:用户可以根据自己的需求和喜好创建自定义的配色方案,包括调整颜色、线型、线宽等属性,并将其保存为自定义的配色方案文件。 3. **交互式调整**:MATLAB提供了交互式的图形界面,用户可以通过拖动滑块或调整参数的方式实时预览不同的配色方案效果,并即时应用到图形中。 配色方案保存: 1. **保存为MATLAB格式**:用户可以将自定义的配色方案保存为MATLAB格式的文件,方便以后在其他MATLAB项目中重复使用。 2. **导出为图片**:用户可以将图形保存为图片格式(如PNG、JPEG等),包括配色方案在内,以便与其他人分享或在文档中使用。 3. **分享和发布**:用户还可以将自己的配色方案分享给其他人,或者发
资源推荐
资源详情
资源评论
收起资源包目录
在 MATLAB 中轻松应用和保存配色方案.zip (52个子文件)
matlab-schemer-master
.gitattributes 883B
develop
sample.xml 532B
sample.cpp 420B
sample.m 498B
sample.java 573B
color2javaRGBint.m 4KB
short_sample.m 357B
sample.tlc 652B
annotated_default.png 59KB
sample.x3d 2KB
sample.v 432B
sample.html 1KB
sample.x3dv 975B
RGBint2hex.m 2KB
sample.vhdl 382B
template_scheme.prf 2KB
LICENSE 1KB
logo.png 23KB
CONTRIBUTING.md 2KB
schemes
screenshots
darksteel.png 31KB
vibrant.png 29KB
solarized-dark.png 31KB
monokai.png 96KB
cobalt.png 30KB
darkmate.png 31KB
tango.png 30KB
default.png 28KB
solarized-light.png 31KB
oblivion.png 31KB
matrix.png 31KB
darksteel.prf 2KB
tango.prf 3KB
vibrant.prf 2KB
.gitattributes 883B
cobalt.prf 2KB
LICENSE 1KB
solarized-dark.prf 3KB
CONTRIBUTING.md 5KB
default.prf 4KB
solarized-light.prf 3KB
oblivion.prf 3KB
darkmate.prf 2KB
.gitignore 80B
README.md 2KB
matrix.prf 1KB
monokai.prf 1KB
react_native.txt 848B
schemer_export.m 30KB
schemer_import.m 34KB
部署必看.txt 0B
.gitignore 80B
README.md 9KB
共 52 条
- 1
资源评论
编程资源宝库
- 粉丝: 3914
- 资源: 2453
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功