-
Notifications
You must be signed in to change notification settings - Fork 0
Themes
ConsoleEmulator supports different themes. These themes are defined using a single JSON file. To add a new theme to ConsoleEmulator, copy the theme's JSON data into the theme file, found at data/internal/themes.json. Continue reading if you want to make your own themes.
themes.json is a JSON array, and each JSON object inside it is a theme. To make your own theme, you need to add a new JSON object to the array.
This chart shows what the tags do: (theme version 0)
| Tag name | Description |
|---|---|
| themeName | Name displayed in theme select menu. |
| creator | Creator displayed in theme select menu. |
| version | What version of the theme system this theme follows. Themes that have a lower number than the standard ConsoleEmulator supports are not loaded. |
| fontFile | Filepath of font that this theme uses. For the default font, use internal/font1.ttf. You can use an absolute path, such as C:/Windows/Fonts/font.ttf, or you can put the font somewhere inside CE's data folder. The latter is recommended, as it is easier to reference in your theme file, and easier to distribute. |
| backgroundColorR | Red component of background color. |
| backgroundColorG | Green component of background color. |
| backgroundColorB | Blue component of background color. |
| foregroundColorR | Red component of foreground color. |
| foregroundColorG | Green component of foreground color. |
| foregroundColorB | Blue component of foreground color. |
| highlightColorR | Red component of highlight color. |
| highlightColorG | Green component of highlight color. |
| highlightColorB | Blue component of highlight color. |
| majorErrorColorR | Red component of color displayed for major errors. |
| majorErrorColorG | Green component of color displayed for major errors. |
| majorErrorColorB | Blue component of color displayed for major errors. |
| unavailableColorR | Red component of color displayed when something is unavailable. |
| unavailableColorG | Green component of color displayed when something is unavailable. |
| unavailableColorB | Blue component of color displayed when something is unavailable. |
| textMatrixAlpha | Transparency of text matrix background |
This is an example of a complete theme:
{
"themeName" : "Builtin Dark",
"creator" : "DIY Labs",
"version" : 0,
"fontFile" : "internal/font1.ttf",
"backgroundColorR" : "0",
"backgroundColorG" : "0",
"backgroundColorB" : "0",
"foregroundColorR" : "255",
"foregroundColorG" : "255",
"foregroundColorB" : "255",
"highlightColorR" : "255",
"highlightColorG" : "176",
"highlightColorB" : "0",
"majorErrorColorR" : 255,
"majorErrorColorG" : 0,
"majorErrorColorB" : 0,
"unavailableColorR" : 150,
"unavailableColorG" : 150,
"unavailableColorB" : 150,
"textMatrixAlpha" : 30,
}
It is recommended to keep majorErrorColor to something noticable, and unavailableColor grayed out, or similar.
themes.json has two default themes, dark and light.
The selected theme is persistent, saved to internal/save.json.
Behavior is undefined if ConsoleEmulator is unable to read the value of a tag, or the font specified does not exist. This is being worked on.
It is recommended to keep textMatrixAlpha low, so as to not be distracting.