BinarySkinSerializer
Reads and writes skins as JSON files.
public static class BinarySkinSerializer
Remarks
A skin file names a built-in skin to start from and lists only what differs: { "format": "binarymission-skin/1", "name": "Harbour", "basedOn": "Black", "colors": { "accent": "#2BA3A3", "surface": "#1C2A30" } } basedOn is one of the BinarySkinTheme names, White when left out. The colours are named as BinarySkinColor is, starting with a lower-case letter, and written #RRGGBB or #AARRGGBB . isDark , prefersSystemBackdrop and cornerRadius may also be given. An accent left out is the one chosen in Windows when the file is read. The selected tab's colours, when not given, are made from the accent to read on the canvas, and isDark , when not given and the surface is, follows the surface. Comments ( // and /* */ ) are allowed. ToJson writes every value, so a file it writes reads back as exactly the same skin.
Members at a glance
FromJson | Reads a skin from JSON text. |
Load | Reads a skin from a file. |
Load | Reads a skin from a stream of UTF-8 text. |
Save | Writes a skin to a file, as UTF-8. |
ToJson | Writes a skin as JSON text. |
Format | The format a skin file declares, and the only one this version reads. |
Methods
FromJson
Reads a skin from JSON text.
- json
- The text.
Returns. The skin.
- BinarySkinFormatException
- The text does not describe a skin.
Load
Reads a skin from a file.
- path
- The file.
Returns. The skin.
- BinarySkinFormatException
- The file does not describe a skin.
Load
Reads a skin from a stream of UTF-8 text.
- stream
- The stream, read to its end and left open.
Returns. The skin.
- BinarySkinFormatException
- The text does not describe a skin.
Save
Writes a skin to a file, as UTF-8.
- skin
- The skin.
- path
- The file, replaced if it exists.
ToJson
Writes a skin as JSON text.
- skin
- The skin.
Returns. The text: every value the skin has, one to a line.
Fields
Format
The format a skin file declares, and the only one this version reads.