Auswertung Experiment

Database tüddelei
DBHanlder läuft gut für DIESE Datanbank struktur...
App begonnen aber weit entfernt von gutem Stand
This commit is contained in:
sioe
2024-11-15 16:51:37 +01:00
parent 553ed19b9f
commit 397cfa61dd
219 changed files with 584 additions and 854 deletions

46
Libs/schemer/.gitattributes vendored Normal file
View File

@@ -0,0 +1,46 @@
# Auto detect text files and perform LF normalization
* text=auto
#
# The above will handle all files NOT found below
#
##---------------------------------------------------
# Common .gitattributes
##---------------------------------------------------
# Documents
# ============
*.txt text
*.md text
# Graphics
# ============
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
*.svg text
*.eps binary
##---------------------------------------------------
# Basic .gitattributes for a MATLAB repo
##---------------------------------------------------
# Source files
# ============
*.m text
*.prf text
# Binary files
# ============
*.p binary
*.mex* binary
*.fig binary
*.mat binary
*.mdl binary
*.slx binary

5
Libs/schemer/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
# Editor autosave files
*~
*.asv
# Compiled MEX binaries (all platforms)
*.mex*

View File

@@ -0,0 +1,47 @@
Contributing
============
Adding a new colour scheme
--------------------------
If you have created a new colour scheme, please add it to the [matlab-schemes]
repository and *not* here. Instructions for this are available
[here](https://github.com/scottclowe/matlab-schemes/blob/master/CONTRIBUTING.md).
If you have already added a new colour scheme to [matlab-schemes] via an
accepted pull request and want to mirror the change in [matlab-schemer], you
will need to use [git-subtree].
Some general handy instructions for `git subtree` are available
[here](https://medium.com/@v/git-subtrees-a-tutorial-6ff568381844#.lwmv2uwwk),
[here](https://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/),
and [here](https://developer.atlassian.com/blog/2015/05/the-power-of-git-subtree/).
Specifically for use with this repository, the instructions are as follows.
You will first need to set up subtree so there is a remote tracking the
[matlab-schemes] repository in addition to the usual origin remote tracking
your fork of [matlab-schemer].
```bash
# One-time setup
git remote add matlab-schemes https://github.com/scottclowe/matlab-schemes.git
```
Having done this setup, you can now merge commits from matlab-schemes into
matlab-schemer as follows:
```bash
git pull
git subtree pull --prefix schemes matlab-schemes master
git push
```
Improving MATLAB Schemer
------------------------
If you have made enhancements or bug fixes to MATLAB Schemer, itself please add
them with a regular [pull request] to this repository.
[matlab-schemer]: https://github.com/scottclowe/matlab-schemer
[matlab-schemes]: https://github.com/scottclowe/matlab-schemes
[git-subtree]: https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt
[pull request]: https://help.github.com/articles/using-pull-requests/

23
Libs/schemer/LICENSE Normal file
View File

@@ -0,0 +1,23 @@
Copyright (c) 2013-2016, Scott C. Lowe <scott.code.lowe@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

204
Libs/schemer/README.md Normal file
View File

@@ -0,0 +1,204 @@
[![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, this is possible!
Please head over to our daughter repository, [matlab-schemes][], which holds the
master copy of the color schemes issued here as part of Schemer in the schemes
directory.
If you fork [matlab-schemes][], add your `.prf` file and issue a pull request,
the new scheme will be reviewed and added to the repository.
This content is then mirrored here using `git subtree`. For more details, see
our [CONTRIBUTING.md](CONTRIBUTING.md).
Addendum
--------
### Requirements
Please note that Schemer requires MATLAB to be run with Java support enabled.
### Further information
For details on how the method was implemented, see
[this Undocumented Matlab article](http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically).
[matlab-schemes]: https://github.com/scottclowe/matlab-schemes
[fex]: http://mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer

View File

@@ -0,0 +1,42 @@
%RGBINT2HEX Convert RGB integer into hexadecimal colour
% HEX = RGBINT2HEX(INT) given an RGB integer, convert it into a
% hexadecimal string.
%
% This is a helper function which you can use when manually creating your
% own MATLAB colour schemes. It is the inverse of COLOR2JAVARGBINT.
%
% See also COLOR2JAVARGBINT.
% Copyright (c) 2015-2016, Scott C. Lowe <scott.code.lowe@gmail.com>
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are
% met:
% * Redistributions of source code must retain the above copyright
% notice, this list of conditions and the following disclaimer.
% * Redistributions in binary form must reproduce the above copyright
% notice, this list of conditions and the following disclaimer in
% the documentation and/or other materials provided with the distribution
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% POSSIBILITY OF SUCH DAMAGE.
function hex = RGBint2hex(int)
% Make a Java colour object
jc = java.awt.Color(int);
% Convert R,G,B into hexadecimal
hex = sprintf('%02s', ...
dec2hex(jc.getRed), dec2hex(jc.getGreen), dec2hex(jc.getBlue));
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@@ -0,0 +1,131 @@
%COLOR2JAVARGBINT Converts a 256-bit color into a corresponding Java int
% INT = COLOR2JAVARGBINT(HEX) converts the hexadecimal string HEX into a
% negative integer INT which is used by Java as an RGB value equivalent
% to the hexadecimal HEX. HEX should be a triple of 256-bit values,
% possibly prepended by a hash ('#'). Alternatively, HEX can be a triple
% of 16-bit values to provide a 16-bit colour instead.
%
% INT = COLOR2JAVARGBINT(RGB) converts the 3-element RGB colour into INT.
%
% INT = COLOR2JAVARGBINT(R, G, B) converts the triple [R G B] into INT.
%
% This is a helper function which you can use when manually creating your
% own MATLAB colour schemes.
% If you have a set of hexadecimal colours which you want to use,
% you can copy the template colour scheme file, then convert each colour
% using COLOR2JAVARGBINT. The output will be a negative integer, which
% should be placed after the appropriate '...=C-' (with a only a single
% minus sign present).
%
% See also SCHEME_EXPORT, RGBINT2HEX.
% Copyright (c) 2013-2016, Scott C. Lowe <scott.code.lowe@gmail.com>
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are
% met:
% * Redistributions of source code must retain the above copyright
% notice, this list of conditions and the following disclaimer.
% * Redistributions in binary form must reproduce the above copyright
% notice, this list of conditions and the following disclaimer in
% the documentation and/or other materials provided with the distribution
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% POSSIBILITY OF SUCH DAMAGE.
function int = color2javaRGBint(X, varargin)
% Input handling
if nargin==3
if ~isnumeric(X) || ~isnumeric(varargin{1}) || ~isnumeric(varargin{2})
error('With three inputs given, all should be scalars');
end
% Concatenate R,G,B together
X = [X(:); varargin{1}(:); varargin{2}(:)];
elseif nargin~=1
error('Incorrect number of inputs. Should be 1 or 3.');
end
if ischar(X)
% Handle Hex string conversion
int = hex2javaRGBint(X);
elseif isnumeric(X)
% Handle RGB conversion
int = RGB2javaRGBint(X);
else
error('Input was neither string nor numeric');
end
end
function int = hex2javaRGBint(hex)
% Input handling
if length(hex)==7 && strcmp(hex(1),'#')
hex = hex(2:end);
end
if length(hex)==3
% Assume a 16-bit colour (fff, 333, 840, etc)
% This should be replicated to make ffffff, 333333, 884400, etc.
% This is sometimes used on the web as shorthand for the 256-bit
% colours, particularly for the grey shades.
hex = reshape(repmat(hex, 2, 1), 1, 6);
elseif length(hex)~=6
% Length should be 6 for a three channel 256-bit hexadecimal
error('Input string was not a hexadecimal number');
end
% Make a Java color object
jc = java.awt.Color(hex2dec(hex));
% Check what the RGB int is equal to
int = jc.getRGB();
% This is equivalent to
% int = hex2dec(hex) - (256^2*255 + 256*255 + 256);
end
function int = RGB2javaRGBint(X)
% Input handling
if numel(X)==1
% Assume input is greyscale
X = repmat(X, 3, 1);
end
if numel(X)~=3
error('Input did not contain three colour channels');
end
if any(X<0)
error('R,G,B cannot be negative');
end
if any(X>255)
error('R,G,B should be not exceed 255');
end
if all(X<1)
% Rescale from 0-1 to 0-255
X = round(X*255);
end
% Convert R, G, and B into a single integer
dec = 256^2 * X(1) + 256 * X(2) + X(3);
% Make a Java color object
jc = java.awt.Color(dec);
% Check what the RGB int is equal to
int = jc.getRGB();
% This is equivalent to
% int = dec - (256^2*255 + 256*255 + 256);
end

View File

@@ -0,0 +1,22 @@
/* Here's a simple Hello World program in C++, which won't
* do much, but does show syntax highlighting.
*/
#include <iostream>
void some_complex_work();
int main()
{
if (2+2==5)
{
// This happens very often indeed
std::cout << "Hello World!";
}
else
{
@ // bad character makes an error
character = 'a';
len = strlen("foobar");
return len;
}
}

View File

@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>Latin Lipsum - Hello, World!</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- You may use a different charset if needed -->
<!--[if !IE]><!-->
<link type="text/css" rel="stylesheet" href="/stylesheets/no-ie.css" />
<!--<![endif]-->
</head>
<body class='main'>
<h1>Hello, World!</h1>
<p id='first'>
Lorem ipsum dolor sit amet, appetere disputationi te eam, eu
cum eius nulla everti. Id eam sale nostrud menandri! Pri an
duis probo, splendide consequuntur ne vis.
</p>
<!-- There is an error with the cellpadding value -->
<table border="0" cellpadding=>
<tr>
<td>
<img src="images/foo.png">
</td>
<td>
Dicta iudico eos ne, at <b>iisque</b> persecuti his.
</td>
</tr>
</table>
<p>
Tale iriure <a href="https://en.wiktionary.org/wiki/laboramus">
laboramus</a> te sea, nec iusto veritus cu, id purto patrioque
sea? Mei at dicit propriae.
</p>
</body>
</html>

View File

@@ -0,0 +1,23 @@
/* HelloWorld.java
* Demonstrates syntax highlighting for Java.
*/
package fibsandlies;
import java.util.HashMap;
class HelloWorld {
/*
* Documentation for the method appears here.
* Prints the string "Hello, world!" to the console.
*/
public static void main(String[] args) {
// Make a character
char c = 'A';
// Assemble the output string
string s = "Hello," + " world" + "!";
int len = s.length();
// Print to screen
System.out.println(s);
// Generate an error
##
}
}

View File

@@ -0,0 +1,21 @@
function sample()
% Create an output file with sys command
!touch test_file.txt
fid = fopen('test_file.txt', 'w');
for i=1:20
fprintf(fid, '%d unterminated\n, i);
end
fclose(fid);
end
function unusedFunc(passedInput)
persistent global_value;
global_value = global_value + 1;
%% Title of cell
printed_var = subFunc(global_value)
unused_var = printed_var;
function out = subFunc(scaleFactor)
fprintf('Scale %.4f\n', scaleFactor);
out = passedInput * scaleFactor;
end
end

View File

@@ -0,0 +1,27 @@
%implements Sample "C"
%% Function: SampleFunction ===============================================
%% Abstract:
%% Doesn't do anything, but does contain some TLC code
%% with syntax highlighting.
%%
%function SampleFunction(inputVal, indexVal) void
%% Need this library to use FILE
%<SLibAddToCommonIncludes("<stdio.h>")>
sprintf("index: %i", indexVal)
%openfile testFile
Some text to verbosely go into the file.
%closefile testFile
%assign myVar = STRING(ParamSettings.Input)
char fileName[%<RTWMaxStringLength>] = "%<myVar>";
%if flagTrue
void *tp = %<nulldef>;
%else
%return ""
%endif
%% [EOF] sample.tlc

View File

@@ -0,0 +1,21 @@
/* Sample Verilog code, which doesn't really do anything
* but it does show syntax highlighting
*/
module main(inputVar, flip);
input inputVar;
input flip;
reg flop;
// Comment about dummy code which doesn't work
always @(posedge flip or posedge inputVar)
if (reset)
begin
flop <= (0 & ~inputVar);
end
else
begin
$display("Hello world!");
$finish;
end
endmodule

View File

@@ -0,0 +1,19 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
-- Comment about the Driver here
entity Driver is
port( x : in std_logic;
F : out std_logic
);
end Driver;
architecture gate_level of Driver is
begin
if newx(x downto (x-3))="0000" then
F <= '1';
else
F <= not(x(2) xor x(2)); --XNOR gate with 2 inputs
end if;
end gate_level;

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"
"http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D version='3.0' profile='Interchange'>
<head>
<meta name='filename' content='sample.x3d' />
</head>
<Scene>
<!-- Define scripts -->
<TouchSensor DEF='TS' />
<Script DEF='Script1'>
<field name='touchTime' type='SFTime' accessType='inputOnly' />
<field name='toScript2' type='SFBool' accessType='outputOnly' />
<field name='toScript3' type='SFBool' accessType='outputOnly' />
<field name='string' type='SFString' accessType='outputOnly' />
<![CDATA[
ecmascript:
function touchTime() {
toScript2 = true;
}
function eventsProcessed() {
string = 'Script1.eventsProcessed';
toScript3 = true;
}
]]>
</Script>
<!-- Draw a blue ball -->
<Transform>
<NavigationInfo headlight='false'
avatarSize='0.25 1.6 0.75' type='"EXAMINE"' />
<DirectionalLight />
<Transform translation='2.0 0.0 1.0'>
<Shape>
<Sphere radius='2.3' />
<Appearance>
<Material diffuseColor='0.0 0.0 1.0' />
</Appearance>
</Shape>
</Transform>
</Transform>
<!-- Set the viewpoint -->
<Viewpoint position='7 -1 18' />
<!-- Set up the scripts -->
<ROUTE fromNode='TS' fromField='touchTime'
toNode='Script1' toField='touchTime' />
<ROUTE fromNode='Script1' fromField='string'
toNode='Collector' toField='fromString' />
<ROUTE fromNode='Collector' fromField='string'
toNode='Result' toField='string' />
</Scene>
</X3D>

View File

@@ -0,0 +1,53 @@
#X3D V3.0 utf8
PROFILE Interchange
META "filename" "sample.x3dv"
# Define scripts
DEF Script1 Script {
inputOnly SFTime touchTime
outputOnly SFBool toScript2
outputOnly SFString string
url [ "ecmascript:
function touchTime() {
toScript2 = TRUE;
}
function eventsProcessed() {
string = 'Script1.eventsProcessed';
toScript3 = TRUE;
}
" ]
}
# Draw a blue ball
Transform {
children [
NavigationInfo {
headlight FALSE
avatarSize [ 0.25 1.6 0.75 ]
type [ "EXAMINE" ]
}
DirectionalLight {
}
Transform {
translation 2.0 0.0 1.0
children [
Shape {
geometry Sphere { radius 2.3
}
appearance Appearance {
material Material { diffuseColor 0.0 0.0 1.0
}
}
}
]
}
]
}
# Set the viewpoint
Viewpoint { position 7 -1 18 }
# Set up the scripts
ROUTE TS.touchTime TO Script1.touchTime
ROUTE Script1.string TO Collector.fromString
ROUTE Collector.string TO Result.string

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mysample SYSTEM "mydtd">
<tag>
<!-- Here is a comment -->
<foo name="value">
Lorem ipsum dolor sit amet.
</foo>
<bar missing>Missing value error in bar tag</bar>
<innertag>
Cibo malorum deseruisse nec at. Fabulas quaestio sit eu, nam
viderer percipit deserunt at.
<![CDATA[
This text is part of the innertag and you can use literal
versions of reserved characters < > & ".
]]>
</innertag>
</tag error>

View File

@@ -0,0 +1,15 @@
function short_sample()
% Short syntax highlighting sample
global gbl_value;
gbl_value = 20
hghlghtvar = 'a_string_example_here';
%% Title of cell
badstring = 'unterminated_string;
unusedvar = hghlghtvar;
!echo "Example `!` system command"
for iterval = 1:2:gbl_value
% This is a very informative comment
fprintf('%s:%d\n',hghlghtvar,iterval);
end
end

View File

@@ -0,0 +1,34 @@
# <theme> - MATLAB color scheme
# Created by <you>
# <date>
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1 # Width of bar for right-hand text limit
ColorsText=C- # Main text colour
ColorsBackground=C- # Main background colour
Colors_M_Keywords=C- # Text for keywords (function, for, end, etc)
Colors_M_Comments=C- # Text for comments
Colors_M_Strings=C- # Text for strings
Colors_M_UnterminatedStrings=C- # Text for unterminated strings
Colors_M_SystemCommands=C- # Text for shell commands
Colors_M_Errors=C- #*Editor error messages and underlines, go-to bars
Colors_HTML_HTMLLinks=C- # Text for URLs
Color_CmdWinWarnings=C- #^Command window Warning text
Color_CmdWinErrors=C- #^Command window Error text
Colors_M_Warnings=C- #*Editor Warning underlines and go-to-warning bars
ColorsMLintAutoFixBackground=C- # Background for autofixable
Editor.VariableHighlighting.Color=C- #*Background for occurances of current variable
Editor.NonlocalVariableHighlighting.TextColor=C- # Text for global variables
Editorhighlight-lines=C- # Background of current cell
Editorhighlight-caret-row-boolean-color=C- # Background of current line
EditorRightTextLimitLineColor=C- # Colour of bar for right-hand text limit
#Legend
# * = Preference does not update until after restarting MATLAB
# ^ = Preference not present on all versions of MATLAB

BIN
Libs/schemer/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,677 @@
%SCHEMER_EXPORT Export current MATLAB color scheme to text file
% If this is your first time using SCHEMER_EXPORT, please ensure you
% read the IMPORTANT NOTE at the bottom of the help section before using
% this function.
%
% SCHEMER_EXPORT() with no input will prompt the user to locate a
% destination file via the GUI, and will save the current color scheme
% to this location. Please read the IMORTANT NOTE below
% before running this script or it may not work correctly.
% The MATLAB preference options which are exported are:
% - All settings in the Color pane of Preferences
% - All settings in the Color > Programming Tools pane
% - From Editor/Debugger > Display pane, the following:
% - Highlight current line (whether to highlight, and the colour)
% - Right-hand text limit (colour and thickness, whether on/off)
% The output format is the same as used in MATLAB's preferences file,
% which is found at FULLFILE(PREFDIR,'matlab.prf').
%
% SCHEMER_EXPORT(FILENAME) exports the relevant MATLAB preferences
% to the file FILENAME.
%
% SCHEMER_EXPORT(FILENAME, FLAG_MODE) controls which settings are output
% into the preference file FILENAME. Along with the colour settings for
% MATLAB syntax highlighting, one can also export the boolean preferences
% (such as whether cells and non-local variables, etc, should be coloured
% differently to the regular backgound and text); and one can also export
% the colour settings for syntax highlighting in other languages
% supported by MATLAB.
%
% The FLAG_MODE settings available are:
% 0 - neither booleans, nor additional languages are exported
% 1 - boolean settings are exported, but not additional languages
% 2 - additional language colours are exported, but not boolean settings
% 3 - both booleans and additional languages are exported
%
% By default FLAG_MODE is set to 1, so boolean settings will be
% exported, but the settings for syntax highlighting in additional
% languages will not be.
%
% The colour settings for all MATLAB syntax highlighting will always be
% exported, even for syntax options which are currently disabled, and
% regardless of whether the boolean settings are being exported. This is
% because users loading your exported color scheme may want syntax
% options highlighted which you are not currently using. Consequently,
% when designing a color scheme, it is advisable to set colours for all
% possisble MATLAB colour settings, even if you don't usually use them.
% By default, SCHEMER_IMPORT will not import boolean settings, so users
% will keep their syntax options enabled or disabled as they prefer even
% after importing your color scheme.
%
% Colours for highlighting syntax in other languages supported by MATLAB
% (MuPAD, TLC, VRML, C++, Java, VHDL, Verilog, XML) can be set in the
% preferences panel Editor/Debugger > Language. If you have not set any
% of these colours yourself, you should not export them. If SCHEMER_IMPORT
% loads a color scheme without additional language syntax included, the
% MATLAB colours are extended to highlight syntax in the other languages
% consistent with the MATLAB scheme.
%
% SCHEMER_EXPORT(FLAG_MODE, FILENAME), with a numeric input followed by a
% string, will also work as above because the input order is reversible.
%
% SCHEMER_EXPORT(FLAG_MODE) with a single numeric input will open the GUI
% to pick the filename and will save the output according to FLAG_MODE.
%
% RET = SCHEMER_EXPORT(...) returns 1 on success, 0 on user
% cancellation at the output file selection screen, -1 on fopen error,
% and -2 on any other error.
%
% [RET, NAMES, PREFS] = SCHEMER_EXPORT(...) also returns two cell
% arrays listing the names and preferences which were saved to file.
%
% For more details on how to get and set MATLAB preferences with
% commands, see the following URL.
% http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically
%
% IMPORTANT NOTE:
% You must have, at any point since installing MATLAB, visited the
% Color, Color>Programming Tools and Editor/Debugger>Display panes of
% the Preferences diaglogue within MATLAB and then clicked OK in order
% for all the settings to be exported correctly. You will obviously have
% done this for any settings you have changed but, for example, you may
% have left the Editor/Debugger>Display settings unchanged. If this
% preference pane has not been set its entries will not have been
% defined, and when trying to export these they will be incorrectly saved
% as off (for booleans) or black (for colours).
%
% Example 1: User is not sure if they have OK'd all the relevent
% Preferences panes (or sure they haven't).
% - Open File>Preferences
% - On the left-hand side
% - Click Colors
% - Click Programming Tools (underneath "Colors" as a subsection)
% - Click Editor/Debugger (a different panel to Colors)
% - Click Display (underneath "Editor/Debugger" as a subsection)
% - Click OK
% (Yes, that is literally all you need to do to make sure you can
% export correctly. There is no need to click anywhere which was
% not mentioned. You just have to have each pane appear, and then
% click OK at the end.)
% - Go to your command window and execute SCHEMER_EXPORT
% - The GUI appears, and you pick where to save the file.
%
% Example 2: User is sure they have OK'd all the relevent Preferences
% panes already.
% schemer_export
%
% Example 3: User is sure they have OK'd all the relevent Preferences
% panes already, knows the path they wish to save to, and doesn't want
% to export their boolean settings.
% schemer_export('some/path/schemeName.prf', 0)
%
% Example 4: User has set some colour preferences for C/C++ syntax
% highlighting in addition to MATLAB syntax highlighting, and wants to
% output this along with their boolean settings
% schemer_export(3)
%
% See also SCHEMER_IMPORT, PREFDIR, COLOR2JAVARGBINT.
% Copyright (c) 2013-2016, Scott C. Lowe <scott.code.lowe@gmail.com>
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are
% met:
% * Redistributions of source code must retain the above copyright
% notice, this list of conditions and the following disclaimer.
% * Redistributions in binary form must reproduce the above copyright
% notice, this list of conditions and the following disclaimer in
% the documentation and/or other materials provided with the distribution
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% POSSIBILITY OF SUCH DAMAGE.
function varargout = schemer_export(fname, flag_mode)
% ------------------------ Parameters -------------------------------------
SCHEMER_VERSION = 'v1.4.0';
SCHEMER_URLGIT = 'https://github.com/scottclowe/matlab-schemer';
SCHEMER_URLFEX = 'https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer';
DEFOUTNAME = 'ColorSchemeForMATLAB.prf';
% ------------------------ Input handling ---------------------------------
% Default inputs
if nargin<2
% Default is on. Recipient can pick themselves whether to import.
flag_mode = 1;
end
if nargin<1
fname = [];
end
% Input switching
if nargin>=1 && ~ischar(fname) && ~isempty(fname)
if ~isnumeric(fname)
error('Invalid input argument 1');
end
if nargin==1
% First input omitted
flag_mode = fname;
fname = [];
elseif ischar(flag_mode)
% Inputs switched
tmp = fname;
fname = flag_mode;
flag_mode = tmp;
clear tmp;
else
error('Invalid combination of inputs');
end
end
% Mode handling
if ~isnumeric(flag_mode)
error('Export mode flag must be numeric.');
elseif flag_mode < 0 || flag_mode > 3
error('Bad mode specified: %s', num2str(flag_mode));
end
inc_bools = mod(flag_mode, 2);
inc_otherlangs = flag_mode >= 2;
% 0: no bools, no other languages
% 1: yes bools, no other languages
% 2: no bools, yes other languages
% 3: yes bools, yes other languages
% ------------------------ Settings ---------------------------------------
% Names of boolean preferences which should always be output
names_boolean = { ...
'ColorsUseSystem' ; ... % Color: Desktop: Use system colors
};
% Names of boolean preferences which the user can choose whether to output
names_boolextra = { ...
'ColorsUseMLintAutoFixBackground' ; ... % Color>PT: Analyser: autofix highlight
'Editor.VariableHighlighting.Automatic' ; ... % Color>PT: Var&fn: auto highlight
'Editor.NonlocalVariableHighlighting' ; ... % Color>PT: Var&fn: with shared scope
'EditorCodepadHighVisible' ; ... % Color>PT: CellDisp: highlight cells
'EditorCodeBlockDividers' ; ... % Color>PT: CellDisp: show lines between cells
'Editorhighlight-caret-row-boolean' ; ... % Editor>Display: Highlight current line
'EditorRightTextLineVisible' ; ... % Editor>Display: Show Right-hand text limit
};
% Names of preferences for which the values are integers
names_integer = { ...
'EditorRightTextLimitLineWidth' ; ... % Editor>Display: Right-hand text limit Width
};
% The names of the main colour panels, so we can let the user know by name
% if there is an issue with any of them
panels_main = { ...
'Color' ; ...
'Color > Programming Tools' ; ...
'Editor/Debugger > Display' ; ...
};
% Names of colour preferences which are in the main panels and used in
% MATLAB syntax highlighting
names_color_main = { ...
{ ... % Color panel
'ColorsText' ; ... % Color: Desktop: main text colour
'ColorsBackground' ; ... % Color: Desktop: main background
'Colors_M_Keywords' ; ... % Color: Syntax: keywords
'Colors_M_Comments' ; ... % Color: Syntax: comments
'Colors_M_Strings' ; ... % Color: Syntax: strings
'Colors_M_UnterminatedStrings' ; ... % Color: Syntax: unterminated strings
'Colors_M_SystemCommands' ; ... % Color: Syntax: system commands
'Colors_M_Errors' ; ... % Color: Syntax: errors
'Colors_HTML_HTMLLinks' ; ... % Color: Other: hyperlinks
} ...
{ ... % Color > Programming Tools
'Colors_M_Warnings' ; ... % Color>PT: Analyser: warnings
'ColorsMLintAutoFixBackground' ; ... % Color>PT: Analyser: autofix
'Editor.VariableHighlighting.Color' ; ... % Color>PT: Var&fn: highlight
'Editor.NonlocalVariableHighlighting.TextColor' ; ... % Color>PT: Var&fn: with shared scope
'Editorhighlight-lines' ; ... % Color>PT: CellDisp: highlight
} ...
{ ... % Editor/Debugger > Display
'Editorhighlight-caret-row-boolean-color' ; ... % Editor>Display: Highlight current line Color
'EditorRightTextLimitLineColor' ; ... % Editor>Display: Right-hand text limit line Color
}
};
% Names of colour preferences which are known to have been added since the
% year 2011, and so their presence in the preferences is not guaranteed
% column 1: name of setting
% column 2: first version in which preference might have been implemented
% column 3: first version in which preference has been observed to exist
names_color_versioned = { ...
'Color_CmdWinWarnings' , ... % Color: Command Window Warning messages
'7.13' , ... % Known to NOT be in 2011a (7.12)
'8.2' ; ... % Known to be in 2013b
'Color_CmdWinErrors' , ... % Color: Command Window Error messages
'8.3' , ... % Known to NOT be in 2013b (8.2)
'8.4' ; ... % Known to be in 2014b
};
% Names of colour preferences for syntax highlighting in languages other
% than MATLAB
names_color_otherlangs = { ...
{ ... % MuPAD
'Editor.Language.MuPAD.Color.keyword' ; ...
'Editor.Language.MuPAD.Color.operator' ; ...
'Editor.Language.MuPAD.Color.block-comment' ; ...
'Editor.Language.MuPAD.Color.option' ; ...
'Editor.Language.MuPAD.Color.string' ; ...
'Editor.Language.MuPAD.Color.function' ; ...
'Editor.Language.MuPAD.Color.constant' ; ...
} ...
{ ... % TLC
'Editor.Language.TLC.Color.Colors_M_SystemCommands' ; ...
'Editor.Language.TLC.Color.Colors_M_Keywords' ; ...
'Editor.Language.TLC.Color.Colors_M_Comments' ; ...
'Editor.Language.TLC.Color.string-literal' ; ...
} ...
{ ... % C/C++
'Editor.Language.C.Color.keywords' ; ...
'Editor.Language.C.Color.line-comment' ; ...
'Editor.Language.C.Color.string-literal' ; ...
'Editor.Language.C.Color.preprocessor' ; ...
'Editor.Language.C.Color.char-literal' ; ...
'Editor.Language.C.Color.errors' ; ...
} ...
{ ... % Java
'Editor.Language.Java.Color.keywords' ; ...
'Editor.Language.Java.Color.line-comment' ; ...
'Editor.Language.Java.Color.string-literal' ; ...
'Editor.Language.Java.Color.char-literal' ; ...
} ...
{ ... % VHDL
'Editor.Language.VHDL.Color.Colors_M_Keywords' ; ...
'Editor.Language.VHDL.Color.operator' ; ...
'Editor.Language.VHDL.Color.Colors_M_Comments' ; ...
'Editor.Language.VHDL.Color.string-literal' ; ...
} ...
{ ... % Verilog
'Editor.Language.Verilog.Color.Colors_M_Comments' ; ...
'Editor.Language.Verilog.Color.operator' ; ...
'Editor.Language.Verilog.Color.Colors_M_Keywords' ; ...
'Editor.Language.Verilog.Color.string-literal' ; ...
} ...
{ ... % XML
'Editor.Language.XML.Color.error' ; ...
'Editor.Language.XML.Color.tag' ; ...
'Editor.Language.XML.Color.attribute' ; ...
'Editor.Language.XML.Color.operator' ; ...
'Editor.Language.XML.Color.value' ; ...
'Editor.Language.XML.Color.comment' ; ...
'Editor.Language.XML.Color.doctype' ; ...
'Editor.Language.XML.Color.ref' ; ...
'Editor.Language.XML.Color.pi-content' ; ...
'Editor.Language.XML.Color.cdata-section' ; ...
}
};
% Names of colour preferences for syntax highlighting in languages other
% than MATLAB
names_color_vrml = { ...
% VRML
'Editor.Language.VRML.Color.keyword' ; ...
'Editor.Language.VRML.Color.node-keyword' ; ...
'Editor.Language.VRML.Color.field-keyword' ; ...
'Editor.Language.VRML.Color.data-type-keyword' ; ...
'Editor.Language.VRML.Color.terminal-symbol' ; ...
'Editor.Language.VRML.Color.comment' ; ...
'Editor.Language.VRML.Color.string' ; ...
};
% First version of matlab which uses VRMLX3DV instead of VRML
version_vrmlx3dv = '9.0';
% Names of preferences for other language syntax and where setting value
% is a string
% column 1: name of preference
% column 2: a regex which the string must match if it is to be exported
% use '.' or '.+' to allow any non-empty string to be output
% use '' or '.*' for anything, including empty strings
% use '\S' for anything except empty or whitespace-only strings
% use '^str1|str2|str3$' to allow only a finite set of strings
names_string_otherlang = { ...
'Editor.Language.Java.method' , ... % Java: Show methods
'^(none|bold|italic)$' ; ...
};
% ------------------------ Setup ------------------------------------------
% Initialise output
if nargout==0
% Empty if no output requested
varargout = {};
else
% -2 to signify unknown error otherwise
varargout = {-2};
end
% If we are outputting all the bools, add them to the list to do
if inc_bools
names_boolean = [names_boolean; names_boolextra];
end
% ------------------------ Check -------------------------------------
% Check the user is not exporting without having visited any of the
% preference panels, or has otherwise set text and background to match
if isequal(com.mathworks.services.Prefs.getColorPref('ColorsText').getRGB, ...
com.mathworks.services.Prefs.getColorPref('ColorsBackground').getRGB)
% Define the base error message. We will add to it depending on the
% exact set up.
msg = 'Colour for text and background appear to be the same.';
% The values match, so give an error
if com.mathworks.services.Prefs.getColorPref('ColorsText').getRGB ...
== -16777216
% Since the colour is black, it seems the user hasn't visited the
% colour preference panes at all
msg = [msg, 10, ...
'Are you sure you have visited all the preference panels,'...
' as per the instructions in the function description?'];
elseif com.mathworks.services.Prefs.getBooleanPref('ColorsUseSystem')
% The colour is something else, but both text and background match.
% The user is managing to use the colours by overriding them with
% the system colours.
msg = [msg, 10, ...
'Although you have enabled system colors, the underlying ', ...
'colour settings match. This is not permitted because the ', ...
'text would be illegible if system colours were disabled.'];
else
% The colour is something else, but both text and background match.
% Presumably the text is currently illegible to the user right now.
msg = [msg, 10, ...
'This is not permitted because the text is illegible.'];
end
% Raise the error with the completed message
error(msg);
end
% Go through all the main color preference panels, checking their settings
% are available to us
% Initialise outer level of holding variables
cprefs_main = cell(size(names_color_main));
colors_main = cell(size(names_color_main));
% Loop over every one of the main colour preference panels
for iPanel = 1:numel(names_color_main)
% Fetch the colours for this panel
[cprefs_main{iPanel}, colors_main{iPanel}] = ...
fetch_colors(names_color_main{iPanel});
% Only give the error on the Color and Programming Tools pages, because
% there are only two colours set in the Editor > Display and they could
% plausibly both be black. We instead check this panel seperately below.
if iPanel <= 2 && all(colors_main{iPanel} == -16777216)
% This panel appears to all be black, so we make an error
error(...
['Colours for all of %1$s panel appear to be black. ' 10 ...
'This will be because you have never set the preferences ' ...
'in this panel. You can do so by visiting the %1$s ' ...
'Preferences page and clicking OK, as detailed in the ' ...
'description of this function.'], panels_main{iPanel});
end
end
% Check the Editor > Display panel has been initialised.
% If it hasn't, the line width will appear to be 0, which is not a possible
% setting.
if com.mathworks.services.Prefs.getIntegerPref(...
'EditorRightTextLimitLineWidth') == 0
% It hasn't been set, so we generate an error
error(...
['Properties from the %1$s preference panel could not be loaded. ' ...
10 ...
'This will be because you have never set the preferences in '...
'this panel. You can do so by visiting the %1$s ' ...
'Preferences page and clicking OK, as detailed in the ' ...
'description of this function.'], panels_main{3});
end
% Let the user know they are doing a stupid thing if they export when using
% the default settings
if com.mathworks.services.Prefs.getBooleanPref('ColorsUseSystem')
warning(...
['You are exporting with system colors for main text and background.'...
10, 'The exported theme will look different on different systems.']);
end
% ------------------------ File stuff -------------------------------------
if isempty(fname)
% Get user's name
username = java.lang.System.getProperty('user.name');
% Prepend username to default filename
outFileName = [char(username) DEFOUTNAME];
% Dialog asking for savename, with smart default output filename
[filename, pathname] = uiputfile(outFileName, ...
'Select file to write MATLAB color scheme');
% End if user cancels
if isequal(filename, 0);
if nargout>0; varargout{1} = 0; end;
return;
end
fname = fullfile(pathname, filename);
end
% Open for write access of text file, create if necessary
fid = fopen(fname, 'w+t', 'n');
if isequal(fid, -1);
if nargout>0; varargout{1} = -1; end;
return;
end
% Add a cleanup object incase of failure
finishup = onCleanup(@() fclose(fid));
% Find the name of the color scheme based on the filename
[~, schemename] = fileparts(fname);
% Write a few comments to the start of the file
fprintf(fid, '# %s - MATLAB color scheme\n', schemename);
fprintf(fid, '# Generated with schemer_export %s, on MATLAB %s\n', ...
SCHEMER_VERSION, version);
fprintf(fid, '# %s\n', char(java.util.Date));
fprintf(fid, '# To enable this color scheme in MATLAB use schemer_import, available at:\n');
fprintf(fid, '# %s\n', SCHEMER_URLGIT);
fprintf(fid, '# %s\n', SCHEMER_URLFEX);
% ------------------------ Read and Write ---------------------------------
% Loop through the boolean type settings
prefs_boolean = cell(size(names_boolean));
for i=1:length(names_boolean)
% Check the name of this preference
nm = names_boolean{i};
% Get the value of this boolean preference
prefs_boolean{i} = com.mathworks.services.Prefs.getBooleanPref(nm);
% Construct the string to output
outstr = [nm '=B'];
if prefs_boolean{i}
outstr = [outstr 'true'];
else
outstr = [outstr 'false'];
end
outstr = [outstr '\n'];
% Write this boolean value to the output file
fprintf(fid, outstr);
end
% Loop through the integer type settings
prefs_integer = cell(size(names_integer));
for i=1:length(names_integer)
% Check the name of this preference
nm = names_integer{i};
% Get the integer value for this preference
prefs_integer{i} = com.mathworks.services.Prefs.getIntegerPref(nm);
% Write this integer value to the output file
fprintf(fid, '%s=I%d\n', nm, prefs_integer{i});
end
% Loop through the colour type settings for MATLAB syntax highlighting
for iPanel=1:numel(names_color_main)
for iPref=1:numel(names_color_main{iPanel})
% Check the name of this preference
nm = names_color_main{iPanel}{iPref};
% Write its colour value to the output file
fprintf(fid, '%s=C%d\n', nm, colors_main{iPanel}(iPref));
end
end
% Loop over colours which may or may not be available
% Initialise cell arrays for successful fields
onames_versioned = {};
cprefs_versioned = {};
% Loop over the colours
for iPref=1:size(names_color_versioned, 1)
% Check the name of this preference
nm = names_color_versioned{iPref, 1};
% Try to get the colour for this preference
prf = com.mathworks.services.Prefs.getColorPref(nm);
% If the current MATLAB version is less the first version where it is
% not known whether it has implemented this preference feature
% Or if the MATLAB version is less than the first version known to have
% implemented the feature and the colour appears to be black
% Then we skip this preference
if verLessThan('matlab', names_color_versioned{iPref, 2}) ...
|| ( ...
verLessThan('matlab', names_color_versioned{iPref, 3}) ...
&& prf.getRGB==-16777216 ...
)
% It appears that this version of MATLAB does not include this
% preference. So we skip it.
continue;
end
% Otherwise, we write its colour value to the output file
fprintf(fid, '%s=C%d\n', nm, prf.getRGB);
% And we add the values to the list to output
onames_versioned{end+1} = nm;
cprefs_versioned{end+1} = prf;
end
% Initialise a cell array to output for other language syntax
onames_langs = {};
cprefs_langs = {};
% Loop through the colour type settings for other language syntax, only if
% it is requested
if inc_otherlangs
% Go through all the language color syntax preference panels, checking
% their settings are available to us
% Loop over every one of the main colour preference panels
for iPanel = 1:numel(names_color_otherlangs)
[panel_prefs, panel_colors] = fetch_colors(...
names_color_otherlangs{iPanel});
if all(panel_colors==-16777216)
% All the colours in this panel are black, so we assume the
% color settings have not loaded because they have not been set
continue;
end
% Not all the colours are black, so we assume we have loaded the
% values for this language panel.
% Loop again over every colour setting in the panel
for iPref = 1:numel(names_color_otherlangs{iPanel})
% Get the name for the color setting we are interested in
nm = names_color_otherlangs{iPanel}{iPref};
% Write its colour value to the output file
fprintf(fid, '%s=C%d\n', nm, panel_colors(iPref));
end
% Remember the prefences so we can return them
onames_langs = [onames_langs; names_color_otherlangs{iPanel}];
cprefs_langs = [cprefs_langs; panel_prefs];
end
end
% We have to do special handling for VRML because in R2016a, MathWorks
% changed the encoding name from VRML to VRMLX3DV. Aside from this, nothing
% else was changed. The rest of the preference name is the same, and the
% default values are unchanged.
if inc_otherlangs
% Deal with VRML and VRMLX3DV possibilities
if verLessThan('matlab', version_vrmlx3dv)
names_color_vrml_usable = names_color_vrml;
else
names_color_vrml_usable = strrep(names_color_vrml, ...
'.VRML.', '.VRMLX3DV.');
end
% Get the colours from the appropriate preference names
[panel_prefs, panel_colors] = fetch_colors(names_color_vrml_usable);
% If all the colours in this panel are black, we assume the color
% settings have not loaded because they have not been set.
if ~all(panel_colors==-16777216)
for iPref = 1:numel(names_color_vrml)
% Get the name for the color setting we are interested in
nm = names_color_vrml{iPref};
% Write its colour value to the output file
fprintf(fid, '%s=C%d\n', nm, panel_colors(iPref));
end
% Remember the prefences so we can return them
onames_langs = [onames_langs; names_color_otherlangs{iPanel}];
cprefs_langs = [cprefs_langs; panel_prefs];
end
end
% Do strings for other languages
if inc_otherlangs
for iPref=1:size(names_string_otherlang, 1)
% Get the name for the string preference we are interested in
nm = names_string_otherlang{iPref, 1};
% Read the string
str = com.mathworks.services.Prefs.getStringPref(nm);
% Turn it from a java.lang.String object to a regular char object
str = char(str);
% Check it is okay
if isempty(regexp(str, names_string_otherlang{iPref, 2}, ...
'start', 'emptymatch'))
% It did not have any matches for the regex, so we will not use
% this setting. We will assume its value is not available.
continue;
end
% It matched the regex for acceptable values, so we will export it
fprintf(fid, '%s=S%s\n', nm, str);
% Remember the prefence so we can return it
onames_langs = [onames_langs; nm];
cprefs_langs = [cprefs_langs; str];
end
end
% ------------------------ Tidy up ----------------------------------------
% fclose(fid); % Don't need to close as it will autoclose
if nargout>0; varargout{1} = 1; end;
fprintf('Exported color scheme to %s\n', fname);
if nargout>1;
varargout{2} = cat(1, ...
names_boolean , ...
names_integer , ...
names_color_main{:} , ...
onames_versioned , ...
onames_langs );
varargout{3} = cat(1, ...
prefs_boolean , ...
prefs_integer , ...
cprefs_main{:} , ...
cprefs_versioned , ...
cprefs_langs );
end
end
function [prefs, colors] = fetch_colors(names)
% Initialise holding variable for settings in this panel
prefs = cell(size(names));
colors = nan(size(names));
% Loop over every colour setting in the panel
for iName = 1:numel(names)
% Read the preference for this colour and get a Java color object
prefs{iName} = com.mathworks.services.Prefs.getColorPref(...
names{iName});
% Turn this into an integer colour value
colors(iName) = prefs{iName}.getRGB;
end
end

View File

@@ -0,0 +1,712 @@
%SCHEMER_IMPORT Import a MATLAB color scheme
% SCHEMER_IMPORT() with no input will prompt the user to locate the
% color theme source file via the GUI.
%
% SCHEMER_IMPORT(FILENAME) imports the color scheme options given in
% the file FILENAME.
%
% SCHEMER_IMPORT(FILENAME, INCLUDEBOOLS) can control whether boolean
% preferences are included in import (default: FALSE). If INCLUDEBOOLS
% is set to true, boolean preference options such as whether to
% highlight autofixable errors, or to show variables with shared scope in
% a different colour will also be overridden, should they be set in the
% input file.
%
% SCHEMER_IMPORT(INCLUDEBOOLS, FILENAME), with a boolean or numeric input
% followed by a string input, will also work as above because the input
% order is reversible.
%
% SCHEMER_IMPORT(INCLUDEBOOLS) with a single boolean input will open the
% GUI to pick the file, and will load boolean preferences in accordance
% with INCLUDEBOOLS.
%
% RET = SCHEMER_IMPORT(...) returns 1 on success, 0 on user
% cancellation at input file selection screen, -1 on fopen error, and -2
% on any other error.
%
% NOTE:
% The file to import can either be a color scheme file as generated by
% SCHEMER_EXPORT, or an entire MATLAB preferences file such as the file
% you will find located at FULLFILE(PREFDIR,'matlab.prf'). This could be
% a MATLAB preferences file taken from a different computer or previous
% MATLAB installation. However, if you are importing from a matlab.prf
% file instead of a color scheme .prf file you should be aware that any
% colour preferences which have been left as the defaults on preference
% panels which the user has not visited on the origin system of the
% matlab.prf file will not be present in the file, and hence not updated
% on import.
%
% The MATLAB preference options which will be overwritten by
% SCHEMER_IMPORT are:
% - All settings in the Color pane of Preferencs
% - All colour settings in the Color > Programming Tools pane, but no
% checkboxes
% - From Editor/Debugger > Display pane, the following:
% - Highlight current line (colour, but not whether to)
% - Right-hand text limit (colour and thickness, but not on/off)
% - From Editor/Debugger > Language, the syntax highlighting colours for
% each language.
%
% Once the current colour preferences are overridden they cannot be
% undone, so it is recommended that you export your current preferences
% with SCHEMER_EXPORT before importing a new theme if you think you
% may wish to revert.
%
% This is not necessary if you are using the default MATLAB color scheme
% which ships with the installation, as SCHEMER comes with a copy of the
% MATLAB default color scheme (default.prf).
%
% If you wish to revert to the default MATLAB color scheme, it is
% recommended you import the file default.prf included in this
% package. This will reset Editor/Debugger>Display colours, colours for
% syntax highlighting in additional languages, as well as the colours set
% in the Colors pane. You can also revert the colors by clicking
% "Restore Default Colors" in the MATLAB preference panel interface, but
% this will be less effective because there are several panels which set
% syntax colours and not all of them have a restore button.
%
% For more details on how to get and set MATLAB preferences with
% commands, see the following URL.
% http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically/
%
% See also SCHEMER_EXPORT, PREFDIR.
% Copyright (c) 2013-2016, Scott C. Lowe <scott.code.lowe@gmail.com>
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are
% met:
% * Redistributions of source code must retain the above copyright
% notice, this list of conditions and the following disclaimer.
% * Redistributions in binary form must reproduce the above copyright
% notice, this list of conditions and the following disclaimer in
% the documentation and/or other materials provided with the distribution
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% POSSIBILITY OF SUCH DAMAGE.
% Known issues:
%
% 1. Text colour of automatically highlighted variables does not change
% colour immediately. This is an issue with matlab; if you change the main
% text colour in the preferences pane, highlighted variables will still
% have the old text colour until matlab is restarted.
%
% 2. Java exception is thrown when first trying to update the setting
% Editor.VariableHighlighting.Color. This only happens the first
% time SCHEMER_IMPORT is run, so the current fix is to catch the error
% and then try again. However, it might be possible for other Java
% exceptions get thrown under other mysterious circumstances, which could
% cause the function to fail.
function varargout = schemer_import(fname, inc_bools)
% ------------------------ Parameters -------------------------------------
SCHEMER_VERSION = 'v1.4.0';
% ------------------------ Input handling ---------------------------------
% ------------------------ Default inputs ---------------------------------
if nargin<2
inc_bools = false; % Default off, so only override extra options if intended
end
if nargin<1
fname = []; % Ask user to select file
end
% Input switching
if nargin>=1 && ~ischar(fname) && ~isempty(fname)
if ~islogical(fname) && ~isnumeric(fname)
error('Invalid input argument 1');
end
if nargin==1
% First input omitted
inc_bools = fname;
fname = [];
elseif ischar(inc_bools)
% Inputs switched
tmp = fname;
fname = inc_bools;
inc_bools = tmp;
clear tmp;
else
error('Invalid combination of inputs');
end
end
% ------------------------ Check for file ---------------------------------
filefilt = ...
{'*.prf' , 'MATLAB preference files (*.prf)' ; ...
'*.prf;*.txt', 'Text and pref files (*.prf, *.txt)'; ...
'*' , 'All Files' };
if ~isempty(fname)
if ~exist(fname, 'file')
error('Specified file does not exist');
end
else
% Dialog asking for input filename
% Need to make this dialogue include .txt by default, at least
[filename, pathname] = uigetfile(filefilt);
% End if user cancels
if isequal(filename, 0);
if nargout>0; varargout{1} = 0; end;
return;
end
fname = fullfile(pathname, filename);
end
% ------------------------ Catch block ------------------------------------
% Somewhat inexplicably, a Java exception is thrown the first time we try
% to set 'Editor.VariableHighlighting.Color'.
% But if we try again immediately, it can be set without any problems.
% The issue is very consistent.
% The solution is to try to set this colour along with all the others,
% catch the exception when it occurs, and then attempt to set all the
% preferences again.
try
[varargout{1:nargout}] = main(fname, inc_bools);
catch ME
if ~strcmp(ME.identifier, 'MATLAB:Java:GenericException');
rethrow(ME);
end
% disp('Threw and ignored a Java exception. Retrying.');
[varargout{1:nargout}] = main(fname, inc_bools);
end
end
% ======================== Main code ======================================
function varargout = main(fname, inc_bools)
% ------------------------ Parameters -------------------------------------
% Names of boolean preferences which should always be imported
names_boolean = { ...
'ColorsUseSystem' ... % Color: Desktop: Use system colors
};
% Names of boolean preferences which the user can choose whether to import
names_boolextra = { ...
'ColorsUseMLintAutoFixBackground' ... % Color>PT: Analyser: autofix highlight
'Editor.VariableHighlighting.Automatic' ... % Color>PT: Var&fn: auto highlight
'Editor.NonlocalVariableHighlighting' ... % Color>PT: Var&fn: with shared scope
'EditorCodepadHighVisible' ... % Color>PT: CellDisp: highlight cells
'EditorCodeBlockDividers' ... % Color>PT: CellDisp: show lines between cells
'Editorhighlight-caret-row-boolean' ... % Editor>Display: Highlight current line
'EditorRightTextLineVisible' ... % Editor>Display: Show Right-hand text limit
};
% Names of preferences for which the values are integers
names_integer = { ...
'EditorRightTextLimitLineWidth' ... % Editor>Display: Right-hand text limit Width
};
% Names of preferences for which the values are strings
% column 1: name of preference
% column 2: a regex which the string must match if it is to be exported
% use '.' or '.+' to allow any non-empty string to be output
% use '' or '.*' for anything, including empty strings
% use '\S' for anything except empty or whitespace-only strings
% use '^str1|str2|str3$' to allow only a finite set of strings
names_string = { ...
'Editor.Language.Java.method' , ... % Java: Show methods
'^(none|bold|italic)$' ; ...
};
% Names of colour preferences, and their default value if not present in
% the .prf file
% column 1: name of preference
% column 2: default value.
% - Empty if no default,
% - Integer if specific colour,
% - String if inherited from another colour setting (which
% should appear higher up in the list)
% - Cell array of strings to take the average colour from
% column 3: whether a restart is required if this value changes
names_color = { ...
'ColorsText' , ... % Color: Desktop: main text colour
'' , ...
false ; ...
'ColorsBackground' , ... % Color: Desktop: main background
'' , ...
true ; ...
'Colors_M_Errors' , ... % Color: Syntax: errors
-65536 , ...
true ; ...
'Colors_M_Warnings' , ... % Color>PT: Analyser: warnings
-27648 , ...
true ; ...
'Colors_M_Keywords' , ... % Color: Syntax: keywords
'ColorsText' , ...
false ; ...
'Colors_M_Comments' , ... % Color: Syntax: comments
{'ColorsText','ColorsBackground'} , ...
false ; ...
'Colors_M_Strings' , ... % Color: Syntax: strings
'ColorsText' , ...
false ; ...
'Colors_M_UnterminatedStrings' , ... % Color: Syntax: unterminated strings
'Colors_M_Errors' , ...
false ; ...
'Colors_M_SystemCommands' , ... % Color: Syntax: system commands
'Colors_M_Keywords' , ...
false ; ...
'Colors_HTML_HTMLLinks' , ... % Color: Other: hyperlinks
'ColorsText' , ...
false ; ...
'Color_CmdWinWarnings' , ... % Color: Other: Warning messages
'Colors_M_Warnings' , ...
false ; ...
'Color_CmdWinErrors' , ... % Color: Other: Error messages
'Colors_M_Errors' , ...
false ; ...
'ColorsMLintAutoFixBackground' , ... % Color>PT: Analyser: autofix
'ColorsBackground' , ...
false ; ...
'Editor.VariableHighlighting.Color' , ... % Color>PT: Var&fn: highlight
'ColorsBackground' , ...
true ; ...
'Editor.NonlocalVariableHighlighting.TextColor' , ... % Color>PT: Var&fn: with shared scope
'ColorsText' , ...
false ; ...
'Editorhighlight-lines' , ... % Color>PT: CellDisp: highlight
'ColorsBackground' , ...
false ; ...
'Editorhighlight-caret-row-boolean-color' , ... % Editor>Display: Highlight current line Color
'Editorhighlight-lines' , ...
false ; ...
'EditorRightTextLimitLineColor' , ... % Editor>Display: Right-hand text limit line Color
-5723992 , ...
false ; ...
'Editor.Language.MuPAD.Color.keyword' , ... % MuPAD: Keywords
'Colors_M_Keywords' , ...
false ; ...
'Editor.Language.MuPAD.Color.operator' , ... % MuPAD: Operators
'Colors_M_SystemCommands' , ...
false ; ...
'Editor.Language.MuPAD.Color.block-comment' , ... % MuPAD: Comments
'Colors_M_Comments' , ...
false ; ...
'Editor.Language.MuPAD.Color.option' , ... % MuPAD: Options
'Colors_M_UnterminatedStrings' , ...
false ; ...
'Editor.Language.MuPAD.Color.string' , ... % MuPAD: Strings
'Colors_M_Strings' , ...
false ; ...
'Editor.Language.MuPAD.Color.function' , ... % MuPAD: System Functions
{'Colors_M_Keywords','ColorsBackground'} , ...
false ; ...
'Editor.Language.MuPAD.Color.constant' , ... % MuPAD: Constants
'Editor.NonlocalVariableHighlighting.TextColor' , ...
false ; ...
'Editor.Language.TLC.Color.Colors_M_SystemCommands' , ... % TLC: Commands
'Colors_M_Keywords' , ...
false ; ...
'Editor.Language.TLC.Color.Colors_M_Keywords' , ... % TLC: Macros
'Colors_M_SystemCommands' , ...
false ; ...
'Editor.Language.TLC.Color.Colors_M_Comments' , ... % TLC: Comments
'Colors_M_Comments' , ...
false ; ...
'Editor.Language.TLC.Color.string-literal' , ... % TLC: C Strings
'Colors_M_Strings' , ...
false ; ...
'Editor.Language.C.Color.keywords' , ... % C/C++: Keywords
'Colors_M_Keywords' , ...
false ; ...
'Editor.Language.C.Color.line-comment' , ... % C/C++: Comments
'Colors_M_Comments' , ...
false ; ...
'Editor.Language.C.Color.string-literal' , ... % C/C++: Strings
'Colors_M_Strings' , ...
false ; ...
'Editor.Language.C.Color.preprocessor' , ... % C/C++: Preprocessor
'Colors_M_SystemCommands' , ...
false ; ...
'Editor.Language.C.Color.char-literal' , ... % C/C++: Characters
'Colors_M_UnterminatedStrings' , ...
false ; ...
'Editor.Language.C.Color.errors' , ... % C/C++: Bad characters
'Colors_M_Errors' , ...
false ; ...
'Editor.Language.Java.Color.keywords' , ... % Java: Keywords
'Colors_M_Keywords' , ...
false ; ...
'Editor.Language.Java.Color.line-comment' , ... % Java: Comments
'Colors_M_Comments' , ...
false ; ...
'Editor.Language.Java.Color.string-literal' , ... % Java: Strings
'Colors_M_Strings' , ...
false ; ...
'Editor.Language.Java.Color.char-literal' , ... % Java: Characters
'Colors_M_UnterminatedStrings' , ...
false ; ...
'Editor.Language.VHDL.Color.Colors_M_Keywords' , ... % VHDL: Keywords
'Colors_M_Keywords' , ...
false ; ...
'Editor.Language.VHDL.Color.operator' , ... % VHDL: Operators
'Colors_M_SystemCommands' , ...
false ; ...
'Editor.Language.VHDL.Color.Colors_M_Comments' , ... % VHDL: Comments
'Colors_M_Comments' , ...
false ; ...
'Editor.Language.VHDL.Color.string-literal' , ... % VHDL: Strings
'Colors_M_Strings' , ...
false ; ...
'Editor.Language.Verilog.Color.Colors_M_Keywords' , ... % Verilog: Keywords
'Colors_M_Keywords' , ...
false ; ...
'Editor.Language.Verilog.Color.operator' , ... % Verilog: Operators
'Colors_M_SystemCommands' , ...
false ; ...
'Editor.Language.Verilog.Color.Colors_M_Comments' , ... % Verilog: Comments
'Colors_M_Comments' , ...
false ; ...
'Editor.Language.Verilog.Color.string-literal' , ... % Verilog: Strings
'Colors_M_Strings' , ...
false ; ...
'Editor.Language.XML.Color.error' , ... % XML: Error
'Colors_M_Errors' , ...
false ; ...
'Editor.Language.XML.Color.tag' , ... % XML: Tag
'Colors_M_Keywords' , ...
false ; ...
'Editor.Language.XML.Color.attribute' , ... % XML: Attribute name
'Colors_M_UnterminatedStrings' , ...
false ; ...
'Editor.Language.XML.Color.operator' , ... % XML: Operator
'Colors_M_SystemCommands' , ...
false ; ...
'Editor.Language.XML.Color.value' , ... % XML: Attribute value
'Colors_M_Strings' , ...
false ; ...
'Editor.Language.XML.Color.comment' , ... % XML: Comment
'Colors_M_Comments' , ...
false ; ...
'Editor.Language.XML.Color.doctype' , ... % XML: DOCTYPE declaration
'Colors_HTML_HTMLLinks' , ...
false ; ...
'Editor.Language.XML.Color.ref' , ... % XML: Character
'Colors_M_UnterminatedStrings' , ...
false ; ...
'Editor.Language.XML.Color.pi-content' , ... % XML: Processing instruction
'Colors_HTML_HTMLLinks' , ...
false ; ...
'Editor.Language.XML.Color.cdata-section' , ... % XML: CDATA section
'Editor.NonlocalVariableHighlighting.TextColor' , ...
false ; ...
'Editor.Language.VRML.Color.keyword' , ... % VRML: Keywords
'Editor.Language.XML.Color.doctype' , ...
false ; ...
'Editor.Language.VRML.Color.node-keyword' , ... % VRML: Node types
'Editor.Language.XML.Color.tag' , ...
false ; ...
'Editor.Language.VRML.Color.field-keyword' , ... % VRML: Fields
'Editor.Language.XML.Color.attribute' , ...
false ; ...
'Editor.Language.VRML.Color.data-type-keyword' , ... % VRML: Data types
'Editor.Language.XML.Color.cdata-section' , ...
false ; ...
'Editor.Language.VRML.Color.terminal-symbol' , ... % VRML: Terminal symbols
'Editor.Language.XML.Color.operator' , ...
false ; ...
'Editor.Language.VRML.Color.comment' , ... % VRML: Comments
'Editor.Language.XML.Color.comment' , ...
false ; ...
'Editor.Language.VRML.Color.string' , ... % VRML: Strings
'Editor.Language.XML.Color.value' , ...
false ; ...
'Editor.Language.VRMLX3DV.Color.keyword' , ... % VRML/X3DV: Keywords
'Editor.Language.VRML.Color.keyword' , ...
false ; ...
'Editor.Language.VRMLX3DV.Color.node-keyword' , ... % VRML/X3DV: Node types
'Editor.Language.VRML.Color.node-keyword' , ...
false ; ...
'Editor.Language.VRMLX3DV.Color.field-keyword' , ... % VRML/X3DV: Fields
'Editor.Language.VRML.Color.field-keyword' , ...
false ; ...
'Editor.Language.VRMLX3DV.Color.data-type-keyword' , ... % VRML/X3DV: Data types
'Editor.Language.VRML.Color.data-type-keyword' , ...
false ; ...
'Editor.Language.VRMLX3DV.Color.terminal-symbol' , ... % VRML/X3DV: Terminal symbols
'Editor.Language.VRML.Color.terminal-symbol' , ...
false ; ...
'Editor.Language.VRMLX3DV.Color.comment' , ... % VRML/X3DV: Comments
'Editor.Language.VRML.Color.comment' , ...
false ; ...
'Editor.Language.VRMLX3DV.Color.string' , ... % VRML/X3DV: Strings
'Editor.Language.VRML.Color.string' , ...
false ; ...
};
verbose = 0;
% ------------------------ Setup ------------------------------------------
if nargout==0
varargout = {};
else
varargout = {-2};
end
if inc_bools
names_boolean = [names_boolean names_boolextra];
end
needs_restart = false;
% ------------------------ Check file seems okay --------------------------
% Read in the contents of the entire file
flestr = fileread(fname);
% Search for occurances of main text colour
txtprf = regexp(flestr, '\sColorsText=(?<pref>[^#\s]+)\s', 'names');
if isempty(txtprf)
error('Text colour not present in colorscheme file:\n%s', fname);
elseif length(txtprf) > 1
error('Text colour defined multiple times in colorscheme file:\n%s', fname);
end
% Search for occurances of main background colour
bkgprf = regexp(flestr, '\sColorsBackground=(?<pref>[^#\s]+)\s', 'names');
if isempty(bkgprf)
error('Background colour not present in colorscheme file:\n%s', fname);
elseif length(bkgprf) > 1
error('Background colour defined multiple times in colorscheme file:\n%s', fname);
end
% Make sure the main text and background colours are not exactly the same
if strcmp(txtprf.pref, bkgprf.pref)
error('Main text and background colours are the same in this file:\n%s', fname);
end
% ------------------------ File stuff -------------------------------------
% Open for read access only
fid = fopen(fname, 'r', 'n');
if isequal(fid, -1);
if nargout>0; varargout{1} = -1; end;
return;
end
% Add a cleanup object incase of failure
finishup = onCleanup(@() fclose(fid));
% ------------------------ Read and Write ---------------------------------
% Initialise tracker for unset colours
isColorSet = false(size(names_color, 1), 1);
% Loop over prf file
while ~feof(fid)
% Get one line of preferences/theme file
l = fgetl(fid);
% Ignore empty lines and lines which begin with #
if length(l)<1 || strcmp('#', l(1))
if verbose; disp('Comment'); end;
continue;
end
% Look for name pref pair, seperated by '='
% Must be at begining of string (hence ^ anchor)
% Cannot contain comment marker (#)
n = regexp(l, '^(?<name>[^=#]+)=(?<pref>[^#]+)', 'names');
% If no match, continue and scan next line
if isempty(n)
if verbose; disp('No match'); end;
continue;
end
% Trim whitespace from pref
n.pref = strtrim(n.pref);
if ismember(n.name, names_boolean)
% Deal with boolean type
switch lower(n.pref)
case 'btrue'
% Preference is true
com.mathworks.services.Prefs.setBooleanPref(n.name, 1);
if verbose; fprintf('Set bool true %s\n', n.name); end
case 'bfalse'
% Preference is false
com.mathworks.services.Prefs.setBooleanPref(n.name, 0);
if verbose; fprintf('Set bool false %s\n', n.name); end
otherwise
% Shouldn't be anything else
warning('Bad boolean for %s: %s', n.name, n.pref);
end
elseif ismember(n.name, names_integer)
% Deal with integer type
if ~strcmpi('I', n.pref(1))
warning('Bad integer pref for %s: %s', n.name, n.pref);
continue;
end
int = str2double(n.pref(2:end));
com.mathworks.services.Prefs.setIntegerPref(n.name, int);
if verbose; fprintf('Set integer %d for %s\n', int, n.name); end
elseif ismember(n.name,names_string(:, 1))
% Deal with string type
if ~strcmpi('S', n.pref(1))
warning('Bad string pref for %s: %s', n.name, n.pref);
continue;
end
str = n.pref(2:end);
% Look up which of the preference settings this is
[~, idx] = ismember(n.name, names_string(:, 1));
% Check that the setting allowed by the regex it must satisfy
if isempty(regexp(str, names_string{idx, 2}, ...
'start', 'emptymatch'))
% If not, we can't set the value to be this
warning('Invalid string for %s: %s', n.name, str);
continue;
end
com.mathworks.services.Prefs.setStringPref(n.name, str);
if verbose; fprintf('Set string %s for %s\n', str, n.name); end
elseif ismember(n.name, names_color(:, 1))
% Deal with colour type (final type to consider)
if ~strcmpi('C', n.pref(1))
warning('Bad color for %s: %s', n.name, n.pref);
continue;
end
[~, idx] = ismember(n.name, names_color(:, 1));
% Get the current setting for this parameter
previousVal = ...
com.mathworks.services.Prefs.getColorPref(names_color{idx, 1});
% Set the colour to the target value
rgb = str2double(n.pref(2:end));
jc = java.awt.Color(rgb);
com.mathworks.services.Prefs.setColorPref(n.name, jc);
com.mathworks.services.ColorPrefs.notifyColorListeners(n.name);
if verbose
fprintf('Set color (%3.f, %3.f, %3.f) for %s\n', ...
jc.getRed, jc.getGreen, jc.getBlue, n.name);
end
% Note that we have allocated this colour
isColorSet(idx) = true;
% Check if the colour has changed
if names_color{idx, 3} && ~isequal(previousVal, jc)
needs_restart = true;
end
else
% Silently ignore irrelevant preferences
% (This means you can load a whole matlab.prf file and anything not
% listed above as relevant to the color scheme will be ignored.)
end
end
% Check that at least one colour was actually set
if ~any(isColorSet)
error('Did not find any colour settings in file\n%s', fname);
if nargout>0; varargout{1} = -2; end;
return;
end
% For colours which have not been set by the color scheme, we set them from
% a backup
% Get a row vector of indices of all unset colours
unsetColorIndices = find(~isColorSet)';
% Loop over unset colours
for idx=unsetColorIndices
% Get the backup setting for this colour parameter
backupVal = names_color{idx, 2};
% Get the current setting for this parameter
previousVal = ...
com.mathworks.services.Prefs.getColorPref(names_color{idx, 1});
clear jc; % Clear variable
% Switch based on the type of backup
if isempty(backupVal)
% No backup is set
continue;
elseif iscell(backupVal)
% Backup is one of several methods of which involve refactoring one
% or more other colours
% Get an RGB value for the colour through whichever method
if all(cellfun(@ischar, backupVal))
% Backup is a list of other names to sample and average
% Initialise a holding matrix
RGB = nan(numel(backupVal), 3);
for i=1:numel(backupVal)
% Load each of the other colours
jc = com.mathworks.services.Prefs.getColorPref(backupVal{i});
% Put the R, G, B values into the holding matrix
RGB(i, 1) = jc.getRed;
RGB(i, 2) = jc.getGreen;
RGB(i, 3) = jc.getBlue;
end
% Take the average of each RGB value from the other colours
RGB = mean(RGB);
elseif length(backupVal)==2
% Backup is a name of a colour and a scale factor to apply
jc = com.mathworks.services.Prefs.getColorPref(backupVal{1});
% Get the R, G, B values
RGB = [jc.getRed, jc.getGreen, jc.getBlue];
% Rescale them
RGB = RGB * backupVal{2};
else
error('Bad backup cell for %s', names_color{idx, 1});
end
% Turn the RGB value into a Java color object
% Ensure RGB is integer and does not exceed 255
RGB = min(255, round(RGB));
% Convert to a float
RGB = RGB/255;
% Make a Java color object for this colour
jc = java.awt.Color(RGB(1), RGB(2), RGB(3));
elseif ischar(backupVal)
% The backup colour is a reference to another colour
% Look up the colour from the backup reference
jc = com.mathworks.services.Prefs.getColorPref(backupVal);
elseif isnumeric(backupVal) && numel(backupVal)==1
% The backup colour is a specific colour
% Make a java color object for this specific colour
jc = java.awt.Color(backupVal);
else
error('Bad backup value for %s', names_color{idx, 1});
end
% Assign the neglected colour to be this Java colour object from the
% backup
com.mathworks.services.Prefs.setColorPref(names_color{idx, 1}, jc);
com.mathworks.services.ColorPrefs.notifyColorListeners(names_color{idx, 1});
% Check if the colour has changed
if names_color{idx, 3} && ~isequal(previousVal, jc)
needs_restart = true;
end
end
% ------------------------ Tidy up ----------------------------------------
% fclose(fid); % Don't need to close as it will autoclose
if nargout>0; varargout{1} = 1; end;
if inc_bools
fprintf('Imported color scheme WITH boolean options from\n%s\n', fname);
else
fprintf('Imported color scheme WITHOUT boolean options from\n%s\n', fname);
end
if needs_restart
disp('Some changes require MATLAB to be restarted to be activated.');
end
end

46
Libs/schemer/schemes/.gitattributes vendored Normal file
View File

@@ -0,0 +1,46 @@
# Auto detect text files and perform LF normalization
* text=auto
#
# The above will handle all files NOT found below
#
##---------------------------------------------------
# Common .gitattributes
##---------------------------------------------------
# Documents
# ============
*.txt text
*.md text
# Graphics
# ============
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
*.svg text
*.eps binary
##---------------------------------------------------
# Basic .gitattributes for a MATLAB repo
##---------------------------------------------------
# Source files
# ============
*.m text
*.prf text
# Binary files
# ============
*.p binary
*.mex* binary
*.fig binary
*.mat binary
*.mdl binary
*.slx binary

5
Libs/schemer/schemes/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
# Editor autosave files
*~
*.asv
# Compiled MEX binaries (all platforms)
*.mex*

View File

@@ -0,0 +1,153 @@
Contributing a colour scheme
============================
Glad to hear you've made a colour scheme to use with [MATLAB Schemer]!
Thanks for sharing this with us.
Please only add one colour scheme per pull request.
If you have multiple colorschemes to add, make a pull request for each of them.
The Schemer README includes some
[advice on creating a colour scheme][scheme creation advice], which you might
find useful.
It is preferable to include a screenshot demonstrating an example of your new MATLAB theme.
To make your screenshot:
- Load your color scheme `schemer_import('yourscheme.prf', 1)`
- Exit MATLAB `exit();`
- Reopen MATLAB
- Open the [matlab-schemer/develop/sample.m] file and take a screenshot with your favourite screenshot program.
- If not done at capture time, crop the screenshot down to the right size with your [favourite image editor].
- Make sure the screenshot is saved in [matlab-schemes/screenshots] as `yourscheme.png`.
If you are on Linux, you can follow the method below to create your screenshot,
which is mostly automated and produces the same output every time.
Reproducible screenshot workflow for Linux
------------------------------------------
Here is minimal-interaction workflow for Linux users, which will create the
same screenshots every time.
This has been tested on Ubuntu 15.10 with MATLAB 2016a, but should work on
any *nix OS and any MATLAB version since R2012b (which introduced the
toolstrip UI).
The code blocks must be run from the system shell, not at the MATLAB command
prompt.
1. **Setup**
Define these variables appropriately.
```bash
# Set this variable appropriately, without extension
SCHEME_NAME='yourschemename'
# Set the path to your copy of MATLAB Schemer
PATH_TO_SCHEMER='../matlab-schemer/'
```
2. **Load scheme**
Run this code block to load the scheme, restart MATLAB, and edit
`sample.m`.
```bash
# Remove extension, if present
SCHEME_NAME=${SCHEME_NAME%.prf}
echo "Making screenshot for scheme $SCHEME_NAME";
# Load the template and restart matlab
matlab -r "addpath(genpath('$PATH_TO_SCHEMER')); schemer_import('$SCHEME_NAME.prf',1); exit;";
# Edit the sample.m file
matlab -r "edit(fullfile('$PATH_TO_SCHEMER','develop','sample.m'))" &
# What next
echo "Now undock sample.m, and highlight middle scaleFactor";
```
3. **Undock sample.m editor**
Either
- in MATLAB GUI, undock `sample.m` only
Or
- in MATLAB GUI, undock the Editor panel
- move tabs to bottom, if more than one file is being editted
Also, make sure the MATLAB toolstrip is visible on the undocked panel.
If it is minimised, right-click on the toolstrip and restore it.
4. **Highlight**
Highlight the middle instance of `scaleFactor` (on line 18).
5. **Resize window and take screenshot**
Run this code block to resize the editor window and take a screenshot,
cropped with ImageMagick.
The crop location is correct for MATLAB 2016a.
```bash
# Check for a window for the develop/sample.m file
if wmctrl -l | grep -q develop/sample.m
then
WINDOW_NAME='develop/sample.m';
else
# If it's not there, use the Editor window
WINDOW_NAME='Editor';
fi
if wmctrl -l | grep -qv "$WINDOW_NAME"
then
echo "Window $WINDOW_NAME is absent";
else
# Resize the window
wmctrl -r "$WINDOW_NAME" -e 0,100,100,700,650;
# Try getting screenshot with Imagemagick, and cropping it down to the
# just the relevant section
wmctrl -a "$WINDOW_NAME"; sleep 0.1; import -window root -crop 700x379+100+249 +repage "${SCHEME_NAME}.png";
# Inspect the result
xdg-open "${SCHEME_NAME}.png";
# Is it cropped correctly?
echo "How does it look? If no good, try one of the other options to manually crop";
fi
```
6. If screenshot cropped incorrectly, **manually crop screenshot**
If the ImageMagick crop is not aligned correctly,
- Either use gnome-screenshot for the whole window, and then crop in GIMP
```bash
wmctrl -a "$WINDOW_NAME" \
&& gnome-screenshot -w -f "$SCHEME_NAME.png" \
&& gimp "$SCHEME_NAME.png";
```
- Or use gnome-screenshot to select the area to use (which is likely to
be less precise).
```bash
wmctrl -a "$WINDOW_NAME" && gnome-screenshot -a -f "$SCHEME_NAME.png";
```
7. When you are happy, **move** the final copy into the screenshots folder
```bash
mv "$SCHEME_NAME.png" screenshots/"$SCHEME_NAME.png";
```
Incorporating into MATLAB Schemer
---------------------------------
Once you've added the new scheme to this repository, it will be merged into
[MATLAB Schemer] using [git-subtree].
If you are merging it into Schemer yourself, please consult this
[step-by-step guide](https://github.com/scottclowe/matlab-schemer/blob/master/CONTRIBUTING.md#adding-a-new-colour-scheme).
[MATLAB Schemer]: https://github.com/scottclowe/matlab-schemer
[matlab-schemes/screenshots]: https://github.com/scottclowe/matlab-schemes/tree/master/screenshots
[matlab-schemer/develop/sample.m]: https://github.com/scottclowe/matlab-schemer/blob/master/develop/sample.m
[scheme creation advice]: https://github.com/scottclowe/matlab-schemer#creating-a-color-scheme-for-others-to-use
[git-subtree]: https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt
[favourite image editor]: https://www.gimp.org

View File

@@ -0,0 +1,23 @@
Copyright (c) 2015, Scott Lowe
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,84 @@
MATLAB Schemes
==============
A collection of color schemes for MATLAB.
These color schemes can be enabled using the [MATLAB Schemer package].
Samples
-------
### Cobalt
Based on the [GTK stylesheet], "Cobalt", by Will Farrington.
![Cobalt sample](screenshots/cobalt.png)
### Darkmate
Based on the [GTK stylesheet], "Darkmate",
by [Luigi Maselli](https://grigio.org/).
![Darkmate sample](screenshots/darkmate.png)
### Dark Steel
By [@scottclowe](https://github.com/scottclowe), inspired by the Darkmate and
Cobalt themes.
![Dark Steel sample](screenshots/darksteel.png)
### Matrix
By [@scottclowe](https://github.com/scottclowe), using only colors present in
the terminals shown in the movie,
[*The Matrix*](http://www.imdb.com/title/tt0133093/).
![Matrix sample](screenshots/matrix.png)
### Monokai
By [@dkearn](https://github.com/dkearn). Based on Sublime Text's Monokai theme. Change the font to Consolas to complete the look.
![Monokai sample](screenshots/monokai.png)
### Oblivion
Based on the [Gedit theme, "Oblivion"](https://github.com/mig/gedit-themes/blob/master/oblivion.xml),
by Paolo Borelli and GtkSourceView.
![Oblivion sample](screenshots/oblivion.png)
### Solarised Dark
Based on the [Solarized][Solarized] (1.0.0beta2) palette, in dark mode,
by [Ethan Schoonover].
![Solarized Dark sample](screenshots/solarized-dark.png)
### Solarised Light
Based on the [Solarized][Solarized] (1.0.0beta2) palette, in light mode,
by [Ethan Schoonover].
![Solarized Light sample](screenshots/solarized-light.png)
### Tango
Based on the colour palette for the [Tango Desktop Project].
![Tango sample](screenshots/tango.png)
### Vibrant
Based on the [GTK stylesheet], "Vibrant", by Lateef Alabi-Oki.
![Vibrant sample](screenshots/vibrant.png)
Default
-------
And of course, you can always return to the original MATLAB color scheme
provided by [MathWorks](https://www.mathworks.com/) using the `default.prf`
color preferences file.
![Default](screenshots/default.png)
[MATLAB Schemer package]: https://github.com/scottclowe/matlab-schemer
[GTK stylesheet]: https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes
[Solarized]: http://ethanschoonover.com/solarized
[Ethan Schoonover]: http://ethanschoonover.com/
[Tango Desktop Project]: http://tango-project.org/

View File

@@ -0,0 +1,33 @@
# SilasColorSchemeForMATLAB - MATLAB color scheme
# Generated with schemer_export v1.4.0, on MATLAB 9.5.0.1586782 (R2018b) Update 8
# Wed Dec 07 13:28:52 CET 2022
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Bfalse
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-2893873
ColorsBackground=C-14144461
Colors_M_Keywords=C-9720087
Colors_M_Comments=C-6380369
Colors_M_Strings=C-3231622
Colors_M_UnterminatedStrings=C-3891200
Colors_M_SystemCommands=C-10443343
Colors_M_Errors=C-2920075
Colors_HTML_HTMLLinks=C-9265201
Colors_M_Warnings=C-217282
ColorsMLintAutoFixBackground=C-2920075
Editor.VariableHighlighting.Color=C-4423978
Editor.NonlocalVariableHighlighting.TextColor=C-7487874
Editorhighlight-lines=C-13288387
Editorhighlight-caret-row-boolean-color=C-11184301
EditorRightTextLimitLineColor=C-11775661
Color_CmdWinWarnings=C-217282
Color_CmdWinErrors=C-2920075

View File

@@ -0,0 +1,45 @@
# Cobalt - MATLAB color scheme
# Created by Scott Lowe, 2015-07-05
# Based on the GTK stylesheet "Cobalt", by Will Farrington.
# https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-1 # white
ColorsBackground=C-16770253 # dark_blue
Colors_M_Keywords=C-25344 # bright_orange
Colors_M_Comments=C-16742145 # sky_blue
Colors_M_Strings=C-12920576 # spring_green
Colors_M_UnterminatedStrings=C-4480 # faded_yellow
Colors_M_SystemCommands=C-3355444 # light grey
Colors_M_Errors=C-65468 # nail_polish_pink
Colors_HTML_HTMLLinks=C-16751169 # light_blue
Colors_M_Warnings=C-20396 #
ColorsMLintAutoFixBackground=C-12303292 #
Editor.VariableHighlighting.Color=C-16728180 # eye-drop
Editor.NonlocalVariableHighlighting.TextColor=C-8323141 # teal_blue
Editorhighlight-lines=C-15981252 # eye-drop
Editorhighlight-caret-row-boolean-color=C-16762000 # medium_blue
EditorRightTextLimitLineColor=C-14665909 # eye-drop
# C/C++
Editor.Language.C.Color.preprocessor=C-8323141 # teal_blue
# Java
Editor.Language.Java.Color.keywords=C-8323141 # teal_blue
# VHDL
Editor.Language.VHDL.Color.operator=C-65468 # nail_polish_pink
# Verilog
Editor.Language.Verilog.Color.operator=C-65468 # nail_polish_pink
# XML/HTML
Editor.Language.XML.Color.tag=C-8323141 # teal_blue
Editor.Language.XML.Color.doctype=C-3355444 # light grey
Editor.Language.XML.Color.pi-content=C-3355444 # light grey
Editor.Language.XML.Color.cdata-section=C-3355444 # light grey

View File

@@ -0,0 +1,34 @@
# Darkmate - MATLAB color scheme
# Created by Scott Lowe, 2015-07-05
# Based on the GTK stylesheet "Darkmate", by Luigi Maselli.
# https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I4 # slightly wider
ColorsText=C-1118482 # white
ColorsBackground=C-14474461 # carbon
Colors_M_Keywords=C-26368 # ambra
Colors_M_Comments=C-10920873 # asfalto
Colors_M_Strings=C-6881536 # lime
Colors_M_UnterminatedStrings=C-202417 # yellow
Colors_M_SystemCommands=C-16725605 # alga
Colors_M_Errors=C-53398 # red
Colors_HTML_HTMLLinks=C-6385153 # violet
Colors_M_Warnings=C-26368 # ambra
ColorsMLintAutoFixBackground=C-11184811 #
Editor.VariableHighlighting.Color=C-4495617 # purple
Editor.NonlocalVariableHighlighting.TextColor=C-16725760 # green
Editorhighlight-lines=C-15132391 #
Editorhighlight-caret-row-boolean-color=C-16777216 # black
EditorRightTextLimitLineColor=C-13948117 #
# XML/HTML
Editor.Language.XML.Color.pi-content=C-6425200

View File

@@ -0,0 +1,44 @@
# Dark Steel - MATLAB color scheme
# Created by Scott Lowe
# Generated with colortheme_export v1.0.0
# Fri Aug 09 18:39:37 BST 2013
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-1
ColorsBackground=C-15066598
Colors_M_Keywords=C-1208813
Colors_M_Comments=C-14114579
Colors_M_Strings=C-16724992
Colors_M_UnterminatedStrings=C-4210944
Colors_M_SystemCommands=C-7123493
Colors_M_Errors=C-45747
Colors_HTML_HTMLLinks=C-10592257
Colors_M_Warnings=C-27648
ColorsMLintAutoFixBackground=C-9223357
Editor.VariableHighlighting.Color=C-11184786
Editor.NonlocalVariableHighlighting.TextColor=C-16735351
Editorhighlight-lines=C-14408662
Editorhighlight-caret-row-boolean-color=C-12632257
EditorRightTextLimitLineColor=C-5723992
# TLC
Editor.Language.TLC.Color.Colors_M_Keywords=C-16735351
# C/C++
Editor.Language.C.Color.preprocessor=C-16735351
# VHDL
Editor.Language.VHDL.Color.operator=C-16735351
# Verilog
Editor.Language.Verilog.Color.operator=C-16735351
# XML
Editor.Language.XML.Color.operator=C-1710454
Editor.Language.XML.Color.doctype=C-6578958
Editor.Language.XML.Color.pi-content=C-9868801

View File

@@ -0,0 +1,95 @@
# Default MATLAB color scheme
# This color scheme file restores the color scheme which ships with MATLAB.
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Btrue
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Bfalse
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-16777216
ColorsBackground=C-1
Colors_M_Keywords=C-16776961
Colors_M_Comments=C-14513374
Colors_M_Strings=C-6283024
Colors_M_UnterminatedStrings=C-5111808
Colors_M_SystemCommands=C-5075968
Colors_M_Errors=C-65536
Colors_HTML_HTMLLinks=C-16776961
Color_CmdWinWarnings=C-39936
Color_CmdWinErrors=C-1703936
Colors_M_Warnings=C-27648
ColorsMLintAutoFixBackground=C-1121868
Editor.VariableHighlighting.Color=C-3479320
Editor.NonlocalVariableHighlighting.TextColor=C-16735325
Editorhighlight-lines=C-197412
Editorhighlight-caret-row-boolean-color=C-2167080
EditorRightTextLimitLineColor=C-3355444
# MuPAD
Editor.Language.MuPAD.Color.string=C-6283024
Editor.Language.MuPAD.Color.constant=C-14638864
Editor.Language.MuPAD.Color.keyword=C-16776961
Editor.Language.MuPAD.Color.function=C-8355662
Editor.Language.MuPAD.Color.block-comment=C-14513374
Editor.Language.MuPAD.Color.option=C-5075968
Editor.Language.MuPAD.Color.operator=C-5103616
# TLC
Editor.Language.TLC.Color.Colors_M_SystemCommands=C-16776961
Editor.Language.TLC.Color.Colors_M_Keywords=C-5075968
Editor.Language.TLC.Color.Colors_M_Comments=C-14513374
Editor.Language.TLC.Color.string-literal=C-6283024
# VRML
Editor.Language.VRML.Color.comment=C-14513374
Editor.Language.VRML.Color.node-keyword=C-16022329
Editor.Language.VRML.Color.field-keyword=C-9145228
Editor.Language.VRML.Color.terminal-symbol=C-2196224
Editor.Language.VRML.Color.keyword=C-16776961
Editor.Language.VRML.Color.data-type-keyword=C-6737152
Editor.Language.VRML.Color.string=C-6283024
# VRML/X3DV
Editor.Language.VRMLX3DV.Color.keyword=C-16776961
Editor.Language.VRMLX3DV.Color.node-keyword=C-16022329
Editor.Language.VRMLX3DV.Color.field-keyword=C-9145228
Editor.Language.VRMLX3DV.Color.data-type-keyword=C-6737152
Editor.Language.VRMLX3DV.Color.terminal-symbol=C-2196224
Editor.Language.VRMLX3DV.Color.comment=C-14513374
Editor.Language.VRMLX3DV.Color.string=C-6283024
# C/C++
Editor.Language.C.Color.keywords=C-16776961
Editor.Language.C.Color.line-comment=C-14513374
Editor.Language.C.Color.string-literal=C-6283024
Editor.Language.C.Color.preprocessor=C-5075968
Editor.Language.C.Color.char-literal=C-48897
Editor.Language.C.Color.errors=C-65536
# Java
Editor.Language.Java.method=Sbold
Editor.Language.Java.Color.keywords=C-16776961
Editor.Language.Java.Color.line-comment=C-14513374
Editor.Language.Java.Color.string-literal=C-6283024
Editor.Language.Java.Color.char-literal=C-48897
# VHDL
Editor.Language.VHDL.Color.Colors_M_Keywords=C-16776961
Editor.Language.VHDL.Color.operator=C-5075968
Editor.Language.VHDL.Color.Colors_M_Comments=C-14513374
Editor.Language.VHDL.Color.string-literal=C-6283024
# Verilog
Editor.Language.Verilog.Color.Colors_M_Comments=C-14513374
Editor.Language.Verilog.Color.operator=C-5075968
Editor.Language.Verilog.Color.Colors_M_Keywords=C-16776961
Editor.Language.Verilog.Color.string-literal=C-6283024
# XML
Editor.Language.XML.Color.error=C-65536
Editor.Language.XML.Color.tag=C-16776961
Editor.Language.XML.Color.attribute=C-5111808
Editor.Language.XML.Color.operator=C-5075968
Editor.Language.XML.Color.value=C-6283024
Editor.Language.XML.Color.comment=C-14513374
Editor.Language.XML.Color.doctype=C-16777092
Editor.Language.XML.Color.ref=C-5111808
Editor.Language.XML.Color.pi-content=C-16777092
Editor.Language.XML.Color.cdata-section=C-8625664

View File

@@ -0,0 +1,31 @@
# Matrix - MATLAB color scheme
# Created by Scott Lowe, 2015-07-05. Modified 2015-04-08.
# Based on the movie of the same name.
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue # with cell bg
EditorCodeBlockDividers=Bfalse # without cell lines
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-15810737
ColorsBackground=C-16448762
Colors_M_Keywords=C-8524550
Colors_M_Comments=C-14199226
Colors_M_Strings=C-15236555
Colors_M_UnterminatedStrings=C-13769101
Colors_M_SystemCommands=C-15122561
Colors_M_Errors=C-2678475
Colors_HTML_HTMLLinks=C-14525287
Colors_M_Warnings=C-10475466
ColorsMLintAutoFixBackground=C-6544075
Editor.VariableHighlighting.Color=C-14855081
Editor.NonlocalVariableHighlighting.TextColor=C-16354525
Editorhighlight-lines=C-16117996
Editorhighlight-caret-row-boolean-color=C-15919586
EditorRightTextLimitLineColor=C-5723992

View File

@@ -0,0 +1,32 @@
# monokai - MATLAB color scheme
# Generated with schemer_export v1.3.5, on MATLAB 8.1.0.604 (R2013a)
# Mon Apr 25 15:03:32 BST 2016
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Bfalse
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-460560
ColorsBackground=C-14211038
Colors_M_Keywords=C-448910
Colors_M_Comments=C-9080482
Colors_M_Strings=C-1647756
Colors_M_UnterminatedStrings=C-65536
Colors_M_SystemCommands=C-16711936
Colors_M_Errors=C-65536
Colors_HTML_HTMLLinks=C-16711681
Colors_M_Warnings=C-27648
ColorsMLintAutoFixBackground=C-11974594
Editor.VariableHighlighting.Color=C-10066330
Editor.NonlocalVariableHighlighting.TextColor=C-16729641
Editorhighlight-lines=C-13421773
Editorhighlight-caret-row-boolean-color=C-10066330
EditorRightTextLimitLineColor=C-3355444
Color_CmdWinWarnings=C-26368

View File

@@ -0,0 +1,52 @@
# Oblivion - MATLAB color scheme
# Created by Scott Lowe, 2015-07-05
# Based on the Gedit theme "Oblivion", by Paolo Borelli.
# https://github.com/mig/gedit-themes
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-2893873 # aluminium2
ColorsBackground=C-13749194 # aluminium6
Colors_M_Keywords=C-1 # white
Colors_M_Comments=C-7828859 # aluminium4
Colors_M_Strings=C-1190912 # butter2
Colors_M_UnterminatedStrings=C-3891200 # butter3
Colors_M_SystemCommands=C-7675340 # chameleon1
Colors_M_Errors=C-1103575 # scarlet1
Colors_HTML_HTMLLinks=C-9265201 # skyblue1
Colors_M_Warnings=C-217282 # orange1
ColorsMLintAutoFixBackground=C-6029312 # scarlet3
Editor.VariableHighlighting.Color=C-11625978 # chameleon3
Editor.NonlocalVariableHighlighting.TextColor=C-9265201 # skyblue1
Editorhighlight-lines=C-13288387 #
Editorhighlight-caret-row-boolean-color=C-11184301 # aluminium5
EditorRightTextLimitLineColor=C-11775661 #
# C/C++
Editor.Language.C.Color.keywords=C-7675340 # chameleon1
Editor.Language.C.Color.preprocessor=C-5406808 # plum1
Editor.Language.C.Color.char-literal=C-9265201 # skyblue1
# Java
Editor.Language.Java.Color.keywords=C-7675340 # chameleon1
Editor.Language.Java.Color.char-literal=C-9265201 # skyblue1
# VHDL
Editor.Language.VHDL.Color.Colors_M_Keywords=C-7675340 # chameleon1
Editor.Language.VHDL.Color.operator=C-1 # white
# Verilog
Editor.Language.Verilog.Color.operator=C-1 # white
Editor.Language.Verilog.Color.Colors_M_Keywords=C-7675340 # chameleon1
# XML/HTML
Editor.Language.XML.Color.tag=C-9265201 # skyblue1
Editor.Language.XML.Color.attribute=C-7675340 # chameleon1
Editor.Language.XML.Color.operator=C-1967753 #
Editor.Language.XML.Color.doctype=C-5406808 # plum1
Editor.Language.XML.Color.pi-content=C-5406808 # plum1
Editor.Language.XML.Color.cdata-section=C-5406808 # plum1

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -0,0 +1,55 @@
# Solarized Dark - MATLAB color scheme
# Manually created on 2015-07-04 by Scott Lowe, based on the style guide of
# http://ethanschoonover.com/solarized
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Bfalse # no cell highlighting
EditorCodeBlockDividers=Btrue # mark cells with line
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-8153962 # base 0
ColorsBackground=C-16766154 # base 03
Colors_M_Keywords=C-3454186 # orange
Colors_M_Comments=C-10981771 # base 01
Colors_M_Strings=C-14251054 # blue
Colors_M_UnterminatedStrings=C-13983336 # cyan
Colors_M_SystemCommands=C-2935166 # magenta
Colors_M_Errors=C-2346449 # red
Colors_HTML_HTMLLinks=C-9670204 # violet
Colors_M_Warnings=C-4880128 # yellow
ColorsMLintAutoFixBackground=C-16304574 # base 02
Editor.VariableHighlighting.Color=C-16304574 # base 02
Editor.NonlocalVariableHighlighting.TextColor=C-8021760 # green
Editorhighlight-lines=C-16766154 # base 03
Editorhighlight-caret-row-boolean-color=C-16304574 # base 02
EditorRightTextLimitLineColor=C-5723992 # matlab cell lines
# MuPAD
Editor.Language.MuPAD.Color.operator=C-8021760 # green
Editor.Language.MuPAD.Color.function=C-4880128 # yellow
Editor.Language.MuPAD.Color.constant=C-2935166 # magenta
# TLC
Editor.Language.TLC.Color.Colors_M_Keywords=C-8021760 # green
# C/C++
Editor.Language.C.Color.preprocessor=C-8021760 # green
Editor.Language.C.Color.char-literal=C-9670204 # violet
# Java
Editor.Language.Java.Color.char-literal=C-9670204 # violet
# VHDL
Editor.Language.VHDL.Color.operator=C-8021760 # green
# Verilog
Editor.Language.Verilog.Color.operator=C-8021760 # green
# XML
Editor.Language.XML.Color.tag=C-14251054 # blue
Editor.Language.XML.Color.attribute=C-4880128 # yellow
Editor.Language.XML.Color.operator=C-8021760 # green
Editor.Language.XML.Color.value=C-13983336 # cyan
Editor.Language.XML.Color.doctype=C-3454186 # orange
Editor.Language.XML.Color.ref=C-9670204 # violet
Editor.Language.XML.Color.pi-content=C-9670204 # violet
Editor.Language.XML.Color.cdata-section=C-2935166 # magenta

View File

@@ -0,0 +1,55 @@
# Solarized Light - MATLAB color scheme
# Manually created on 2015-07-04 by Scott Lowe, based on the style guide of
# http://ethanschoonover.com/solarized
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Bfalse # no cell highlighting
EditorCodeBlockDividers=Btrue # mark cells with line
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-10126461 # base 00
ColorsBackground=C-133405 # base 3
Colors_M_Keywords=C-3454186 # orange
Colors_M_Comments=C-7102047 # base 1
Colors_M_Strings=C-14251054 # blue
Colors_M_UnterminatedStrings=C-13983336 # cyan
Colors_M_SystemCommands=C-2935166 # magenta
Colors_M_Errors=C-2346449 # red
Colors_HTML_HTMLLinks=C-9670204 # violet
Colors_M_Warnings=C-4880128 # yellow
ColorsMLintAutoFixBackground=C-1120043 # base 2
Editor.VariableHighlighting.Color=C-1120043 # base 2
Editor.NonlocalVariableHighlighting.TextColor=C-8021760 # green
Editorhighlight-lines=C-133405 # base 00
Editorhighlight-caret-row-boolean-color=C-1120043 # base 2
EditorRightTextLimitLineColor=C-5723992 # matlab cell lines
# MuPAD
Editor.Language.MuPAD.Color.operator=C-8021760 # green
Editor.Language.MuPAD.Color.function=C-4880128 # yellow
Editor.Language.MuPAD.Color.constant=C-2935166 # magenta
# TLC
Editor.Language.TLC.Color.Colors_M_Keywords=C-8021760 # green
# C/C++
Editor.Language.C.Color.preprocessor=C-8021760 # green
Editor.Language.C.Color.char-literal=C-9670204 # violet
# Java
Editor.Language.Java.Color.char-literal=C-9670204 # violet
# VHDL
Editor.Language.VHDL.Color.operator=C-8021760 # green
# Verilog
Editor.Language.Verilog.Color.operator=C-8021760 # green
# XML
Editor.Language.XML.Color.tag=C-14251054 # blue
Editor.Language.XML.Color.attribute=C-4880128 # yellow
Editor.Language.XML.Color.operator=C-8021760 # green
Editor.Language.XML.Color.value=C-13983336 # cyan
Editor.Language.XML.Color.doctype=C-3454186 # orange
Editor.Language.XML.Color.ref=C-9670204 # violet
Editor.Language.XML.Color.pi-content=C-9670204 # violet
Editor.Language.XML.Color.cdata-section=C-2935166 # magenta

View File

@@ -0,0 +1,66 @@
# Tango - MATLAB color scheme
# Created by Scott Lowe, 2015-07-05, Modified 2016-04-08
# Based on the colours specified for use in the Tango Project.
# http://tango-project.org/
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
#
# Palette, taken from
# https://en.wikipedia.org/wiki/Tango_Desktop_Project#Palette
# | Light Medium Dark
# --------------+------------------------------------
# Butter | -202417 -1190912 -3891200
# Orange | -217282 -689920 -3253248
# Chocolate | -1459858 -4096751 -7382782
# Chameleon | -7675340 -9186794 -11625978
# Sky Blue | -9265201 -13343324 -14660985
# Plum | -5406808 -9088901 -10734234
# Scarlet Red | -1103575 -3407872 -6029312
# Aluminium (l) | -1118484 -2893873 -4538954
# Aluminium (d) | -7828859 -11184301 -13749194
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-11184301 # aluminium-dark
ColorsBackground=C-1 # white
Colors_M_Keywords=C-6029312 # scarletred-dark
Colors_M_Comments=C-9265201 # skyblue-light
Colors_M_Strings=C-5406808 # plum-light
Colors_M_UnterminatedStrings=C-13343324 # skyblue
Colors_M_SystemCommands=C-4096751 # chocolate
Colors_M_Errors=C-1103575 # scarletred-light
Colors_HTML_HTMLLinks=C-13343324 # skyblue
Colors_M_Warnings=C-217282 # orange-light
ColorsMLintAutoFixBackground=C-4538954 # aluminium-light
Editor.VariableHighlighting.Color=C-202417 # butter-light
Editor.NonlocalVariableHighlighting.TextColor=C-11625978 # chameleon-dark
Editorhighlight-lines=C-1118484 # aluminium-white
Editorhighlight-caret-row-boolean-color=C-2893873 # aluminium-vlight
EditorRightTextLimitLineColor=C-7828859 # aluminium
# C/C++
Editor.Language.C.Color.keywords=C-11625978
Editor.Language.C.Color.char-literal=C-3891200
# Java
Editor.Language.Java.Color.keywords=C-11625978
Editor.Language.Java.Color.char-literal=C-3891200
# VHDL
Editor.Language.VHDL.Color.operator=C-11625978
# Verilog
Editor.Language.Verilog.Color.operator=C-11625978
# XML/HTML
Editor.Language.XML.Color.error=C-1103575
Editor.Language.XML.Color.tag=C-6029312
Editor.Language.XML.Color.attribute=C-11625978
Editor.Language.XML.Color.operator=C-1190912
Editor.Language.XML.Color.value=C-4096751
Editor.Language.XML.Color.doctype=C-689920
Editor.Language.XML.Color.ref=C-3891200
Editor.Language.XML.Color.pi-content=C-13343324
Editor.Language.XML.Color.cdata-section=C-5406808

View File

@@ -0,0 +1,32 @@
# Vibrant - MATLAB color scheme
# Created by Scott Lowe, 2015-07-12
# Based on the GTK stylesheet "Vibrant", by Lateef Alabi-Oki.
# https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes
# To enable this color scheme in MATLAB use schemer_import, available at:
# https://github.com/scottclowe/matlab-schemer
# https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer
ColorsUseSystem=Bfalse
ColorsUseMLintAutoFixBackground=Btrue
Editor.VariableHighlighting.Automatic=Btrue
Editor.NonlocalVariableHighlighting=Btrue
EditorCodepadHighVisible=Btrue
EditorCodeBlockDividers=Btrue
Editorhighlight-caret-row-boolean=Btrue
EditorRightTextLineVisible=Btrue
EditorRightTextLimitLineWidth=I1
ColorsText=C-11711155 # text_fg
ColorsBackground=C-1 # white
Colors_M_Keywords=C-6815487 # accent_deep_red
Colors_M_Comments=C-183551 # accent_red
Colors_M_Strings=C-16684599 # accent_blue_base
Colors_M_UnterminatedStrings=C-16698473 # accent_blue_shadow
Colors_M_SystemCommands=C-10092340 # accent_dark_violet
Colors_M_Errors=C-2883584 # accent_red_base
Colors_HTML_HTMLLinks=C-16766147 # ubuntu_toner
Colors_M_Warnings=C-292096 # orange_base
ColorsMLintAutoFixBackground=C-140901 # human_highlight
Editor.VariableHighlighting.Color=C-256 # yellow
Editor.NonlocalVariableHighlighting.TextColor=C-13395712 # accent_green_base
Editorhighlight-lines=C-66341 # custom
Editorhighlight-caret-row-boolean-color=C-131175 # accent_yellow_highlight
EditorRightTextLimitLineColor=C-140901 # human_highlight