Unryu: Themes

Unryu has two independent themes: a window theme for the menus, panels and dialogs, and an editor theme (also called a color scheme) for everything a document shows. This page explains how to choose each one, lists every key of the editor theme file with what it colors and what it falls back to, and shows how to write your own scheme.

1. The two themes

The window theme gives colors to the parts of the program around the text: the menu bar and menus, the toolbar, the panel headers and tab bars, buttons, fields, lists, the status bar and every dialog. The editor theme gives colors to the text: the background of the editor, the selection and cursor, the margins, every kind of token and name, and all the marks that Unryu draws over the code (brace pairs, uses of the name at the cursor, search matches and so on). You can combine any window theme with any editor theme.

Window themeEditor theme (color scheme)
ColorsMenus, toolbar, panel headers, tab bars, buttons, fields, the status bar, dialogsThe editor, the formatted Markdown view, Details, the Symbols, Documents and Files lists, the message window's lists, the tooltip over a name, the completion list, and (by default) the terminal
Choose it withView > Change Theme..., or Edit > Preferences > Interface, field Window:View > Change Color Scheme..., or Edit > Preferences > Interface, field Editor:
Your own files~/.config/unryu/themes/~/.config/unryu/editor_themes/
Other files14 built-in themes, and themes installed in the system theme foldersThe editor_themes folder that comes with Unryu (51 schemes)
Setting in unryu.conftheme (default: Dark)editor-theme (default: Dark)

If XDG_CONFIG_HOME is set, Unryu uses $XDG_CONFIG_HOME/unryu/ in place of ~/.config/unryu/ everywhere on this page. The window themes' folder follows XDG_CONFIG_HOME only when it is a full path (starting with /); otherwise it stays ~/.config/unryu/themes/.

The Symbols list, the Documents list, Details and the message window use the editor theme's colors because they show code, so a function has the same color in the Symbols list as in the editor. Their fonts and sizes still come from the window theme and from Preferences. Section 9 explains exactly which colors each panel uses.

2. Choosing a theme

The Color Schemes and Themes dialogs

View > Change Color Scheme... opens a dialog titled Color Schemes with a list of every editor theme. View > Change Theme... opens the same dialog, titled Themes, with a list of every window theme. Both work the same way:

While the dialog is open the main window keeps repainting and the terminal keeps running, but you cannot use the main window until you close it. Document > Set Filetype... uses the same dialog for the list of languages (see Languages).

The editor themes are listed with Default first, then alphabetically without regard to case. The window themes are listed alphabetically.

Preferences

WhereControlWhat it does
Interface > ThemesWindow:A drop-down list of the window themes. "The theme of the window: menus, panels, buttons and lists."
Interface > ThemesEditor:A drop-down list of the editor themes. "The color theme of the text in the editor and in Details."
Interface > ThemesIcons: and Icons of all xtk programs:The icon theme of Unryu, and of every xtk program (see Icons, below).
Editor > DisplayInvert syntax highlighting colorsShows every color of the editor theme as its opposite (each red, green and blue value is inverted), including the editor's background. The setting is invert-colors in unryu.conf.
Editor > DisplayLong line marker, Color:The color of the long line marker is a Preferences setting (long-line-color, default #C2EBC2), not a theme key.
Terminal > AppearanceTheme: As the editor themeThe default. The terminal reads its colors from the editor theme's file (see section 9).

A theme chosen in Preferences takes effect when you press Apply or OK. Pressing Apply also reads the editor theme's file again, which is useful while you edit a theme (section 11).

Icons

Unryu draws the icons of its toolbar, menus and Files tab from an icon theme: the same icon themes the rest of your desktop uses (Adwaita, Breeze, Papirus, Numix and the others in /usr/share/icons and ~/.local/share/icons). A theme's icons are drawn in the theme's own colors, as GTK programs show them. Two settings in Preferences > Interface > Themes choose it:

SettingChoices
IconsUnryu's own choice. "As every xtk program" (the default) follows the next setting. "The desktop's" is the icon theme your desktop uses. "Unryu's own icons" are its built-in one-color icons, in the window theme's colors. Or one of the installed icon themes.
Icons of all xtk programsThe choice of every program built on xtk that does not make its own: Unryu, Hanshi, Palette, Gamut, Skein and PixelPrism. "The desktop's" (the default), "xtk's own icons", or one of the installed icon themes. It is kept in ~/.config/xtk/icons.conf; a change here reaches the others while they run.

The desktop's icon theme is the one your desktop announces (XSETTINGS, which GNOME, Xfce, MATE, LXDE and xsettingsd give), else the one in ~/.config/gtk-4.0/settings.ini, ~/.config/gtk-3.0/settings.ini or ~/.gtkrc-2.0 (gtk-icon-theme-name), else the one in ~/.config/kdeglobals. When you change it, Unryu's icons change with it while it runs.

Following the standards. Icons are found as the freedesktop.org Icon Theme and Icon Naming specifications say: every folder a theme lists, at any size and scale, and an icon file that is in no theme; a name the theme lacks is tried shorter in that theme before the themes it builds on ("go-previous-symbolic", then "go-previous"), but a file type's icon is not. A file's icon comes from your theme before a more exact one in an older theme, so the Files tab keeps your theme's look. A theme or an icon you install shows within a few seconds, without restarting. Themes that write their folder types in small letters ("fixed") are read as GTK reads them.

How an icon is found. Each button asks for the icon by the name the Icon Naming Specification gives its action (document-save for Save, edit-find for Find, ...). Four actions have no name there: Save All, Close All, Build and the Color Chooser. For those Unryu asks for the name the common themes use (document-save-all, document-close-all, run-build, color-select: Breeze, Papirus, Oxygen and the themes made from them have most of them). A theme that draws only the standard's names (GNOME's, for one) has none of them, so Unryu builds those buttons from that theme's own icons, and the toolbar keeps one look: Save All is two of its Save icons, one behind the other; Close All two of its document icons with its Close icon as a small badge; Build its source-file icon with its gears (system-run) as a small badge. The Color Chooser has nothing to be built from, so it takes the theme's graphics-programs icon (applications-graphics, a palette in most themes). Only when a theme lacks even those parts does Unryu draw its own icon. Unryu never asks for an old GTK name (gtk-*) or another program's own icon name (geany-*). The names are looked for theme by theme: first in your theme, then in the themes it builds on (its Inherits line), then in hicolor, which every system has. Your theme's own icon wins over one that only an older theme has, so the toolbar keeps your theme's look. When none of them has it, Unryu draws its own icon.

Symbolic icons. The Markdown toolbar, and the main toolbar with Preferences > Interface > Toolbar > Icon look > Symbolic, draw symbolic icons, as GTK and KDE programs draw their toolbars: one color, the toolbar's text color, so they follow a light or a dark window theme. Each button asks your theme for its name with -symbolic after it (format-text-bold-symbolic), the themes it builds on and hicolor; then Adwaita's symbolic set, which is what GTK falls back to; then Unryu draws its own icon in the same color. Since every icon is one-color line art, a row from the three still reads as one set: under GNOME's theme, which has no symbolic icons, the Markdown toolbar takes Adwaita's and Unryu's own; under Breeze and Papirus, nearly all are the theme's. Tip's icon is a sparkle, not a bulb, because Adwaita and GNOME draw Note's "information" icon as a bulb.

Icons that only pretend. Some themes fill a name with a link to another icon: Papirus links Geany's "Close All" to the plain Close icon, so the two buttons would look the same. Unryu passes over an icon that is a link to the icon of a button it must not look like (Save All and Save, Close All and Close, the Color Chooser and Preferences, Build and Execute, Replace and Find), or that is the same file, and takes the next name.

Help > About shows Unryu's logo, whatever the theme. A disabled toolbar button or menu item shows its theme icon in grey and faint. In the Files tab, each file shows the theme's icon for its type, found by its name as file managers do.

An icon theme made for a light desktop has dark icons, which are hard to see on a dark window theme (and the other way round): choose the theme's dark variant (Papirus-Dark, Breeze Dark ...) to go with a dark window theme.

3. Where the theme files are

Editor themes

Unryu looks for editor themes in these folders, in this order. A theme in a later folder replaces a theme with the same name (compared without regard to case) from an earlier folder:

  1. The folders that come with Unryu: share/unryu/editor_themes next to the installed program (for example /usr/share/unryu/editor_themes), editor_themes one folder above the program, and editor_themes beside the program.
  2. Your own folder, ~/.config/unryu/editor_themes/.

Older versions of Unryu named this folder ~/.config/unryu/editor_theme (without the "s"). If only that folder exists, Unryu renames it to editor_themes once, with your themes in it.

The first time Unryu starts and your folder does not exist, it creates the folder and puts a copy of every shipped theme in it. Those copies are yours to change. Unryu notes each theme it copied in a list in the folder (.shipped), so a theme that you delete stays deleted, and a theme added in a newer version of Unryu is copied in the first time that version starts. A folder made by a version before this list gets each missing theme once more, so a theme you deleted from it can come back that one time.

Window themes

4. The color schemes that come with Unryu

Unryu ships 51 editor themes. All but Default were converted from Geany color schemes; the last column names the Geany scheme file. Default was made from Geany's own default colors and is a light theme in which every key except the four message tab label keys (section 10) is written out.

NameBackgroundConverted from
Defaultlightfiletypes.common
Abc Darkdarkabc-dark.conf
Abc Lightlightabc-light.conf
Alternatelightalt.conf
Bespindarkbespin.conf
Black Schemedarkblack.conf
Chocolatedarkchocolate.conf
Cyber Sugardarkcyber-sugar.conf
Darculadarkdarcula.conf
Dark (the default)darkdark.conf
Dark Colorsdarkdark-colors.conf
Dark Fruit Saladdarkdark-fruit-salad.conf
Delt Darkdarkdelt-dark.conf
Earthsongdarkearthsong.conf
Epsilonlightepsilon.conf
Evg-EGA-Darkdarkevg-ega-dark.conf
Fluffylightfluffy.conf
Geditlightgedit.conf
GitHublightgithub.conf
grey8mid greygrey8.conf
Gruvboxdarkgruvbox_material_dark.conf
Hackerdarkhacker.conf
Himbeeredarkhimbeere.conf
InkPotdarkinkpot.conf
Kary Pro Colors - Bare Darkdarkkary-pro-colors-dark.conf
Kary Pro Colors - Bare Lightlightkary-pro-colors-light.conf
KoffieShopdarkkoffieshop.conf
Kugeldarkkugel.conf
Liquibytedarkliquibyte.conf
Matchadarkmatcha.conf
Metallic Bottlelightmetallic-bottle.conf
Monokaidarkmonokai.conf
Notepad-plus-pluslightnotepad-plus-plus.conf
Oblivion 2darkoblivion2.conf
One Darkdarkone-dark.conf
Pygmentslightpygments.conf
Railcasts 2darkrailcasts2.conf
Ralesk's MCdark (blue)mc.conf
Retrodark (one color)retro.conf
Sleepy Pasteldarksleepy-pastel.conf
Slush and Poppieslightslushpoppies.conf
Solarized (dark)darksolarized-dark.conf
Solarized (light)lightsolarized-light.conf
Spyder Darkdarkspyder-dark.conf
Steampunkdarksteampunk.conf
Tangodarktango-dark.conf
Tango Lightlighttango-light.conf
Tingedarktinge.conf
Ubuntulightubuntu.conf
Vibrantdarkvibrant-ink.conf
Zenburndarkzenburn.conf

5. The editor theme file

An editor theme is a plain text file with sections in square brackets and one key = value per line. Lines that start with ; or # are comments, and spaces around the key and the value are ignored. The shipped themes contain almost every key: only the four message tab label keys of section 10 are left out, so they always take their fallbacks. Most keys have a comment above them that says what they color; the keys of [declared] share one comment at the top of their section. The easiest way to learn the format is to open one of them. You can also leave keys out: every key has a fallback (section 8), so a theme of three or four lines already works.

; Unryu editor theme: Dark
[theme]
name = Dark
source = dark.conf

[editor]
; the view's background
background = #1E1E1E
; text with no other color
text = #FFFFFF
; the background of the cursor's line; none: not drawn
current-line = #2F2F2F
; the text on the cursor's line; syntax: each token's own color
current-line-text = syntax

[syntax]
; a statement word: if, return, static ...
keyword = #FFCB4F - bold
comment = #747474 -

[names]
type-name = #2E8B57 - bold
macro = #5ABEFD -

[declared]
macro = #283842
macro-text = #5ABEFD

[marks]
brace-good = - #50AA15 bold
pair-range = #23242D
pair-range-text = syntax

Kinds of values

KindWritten asUsed in
Color#rrggbb or #rgb (so #f80 is #FF8800). Upper or lower case.All keys of [editor] and [declared], and the color keys of [marks]
Styleforeground background [bold] [italic], separated by spaces. Write - for a part you do not want to set: a - foreground is the plain text color ([editor] text), and a - background is the editor's background. You can leave the background out entirely (#FF0000 alone), and bold and italic can come in any order after the colors. An empty value is plain text.All keys of [syntax] and [names], and brace-good and brace-bad in [marks]
noneThe word noneOnly current-line: the cursor's line gets no background.
syntaxThe word syntax (none means the same here)The text keys that sit on a highlight: current-line-text, every -text key of [declared], and pair-likely-text, pair-ambiguous-text, pair-range-text, occurrence-text, search-mark-text and open-elsewhere-text. The text keeps its normal syntax color instead of one fixed color.

A value that Unryu cannot read (a misspelled color, an unknown word in a style) is ignored, and the key takes its fallback. Unknown keys and unknown sections are ignored too.

6. Key reference

In the fallback column, "a mix of A and B at N%" means a color N% of the way from A to B. "Background" and "text" always mean [editor] background and [editor] text. A style that falls back to another key copies all of it: foreground, background, bold and italic.

[theme]: the theme's name

KeyMeaningIf left out
nameThe name shown in the lists and stored in unryu.confThe file name without .conf
descriptionShown under the list in the Color Schemes dialogThe note names the source instead
sourceThe Geany color scheme file the colors came fromNo note

[editor]: the editor view (every key is a color)

KeyWhat it colorsIf left out
backgroundThe editor's background#FFFFFF (white)
textText with no other color#000000 (black)
selectionThe selection's background#C0C0C0 (light grey)
selection-textText in the selectiontext
caretThe text cursortext
current-lineThe background of the line that holds the cursor; none turns it offA faint tint: a mix of background and text at 8%
current-line-textText on the cursor's line; syntax keeps each token's colorsyntax
line-numbersThe line numberstext
line-numbers-backgroundThe line number marginbackground
fold-marginThe fold marginline-numbers-background
fold-markerThe fold boxes, and the line drawn under a folded lineline-numbers
white-spaceThe dots and arrows of Show White Spaceline-numbers
line-endingThe line ending boxes of Show Line Endingswhite-space
indent-guideThe lines of Show Indentation Guidesline-numbers
borderThe edge of the editor, and the lines between its marginsA mix of background and text at 20%
scrollbar-thumbThe scrollbar's thumbA mix of background and text at 35%
tooltipThe background of the tooltip over a name (the syntax colors are drawn on it)background
tooltip-textThe tooltip's plain texttext
tooltip-borderThe tooltip's edgeA mix of tooltip and tooltip-text at 25%
marker-marginThe markers margin (View > Show Markers Margin)line-numbers-background
markerA bookmark's arrow in the markers margin (Ctrl+M)#B8F4B8 (light green)
change-modifiedChange history: a line changed and not saved yet. Also the Documents and Files lists' color for a file with unsaved changes.#FF8000 (orange)
change-savedChange history: a line changed and saved#00A000 (green)
error-indicatorThe wavy line under a line on which the compiler found an error#FF0000 (red)
vcs-added, vcs-changed, vcs-deletedThe change bar: a line added, a line changed, lines deleted (a wedge) since the last commit or since the file was opened (Git)#58B058, #4C8ED9, #D9534F
breakpointThe debugger: a breakpoint's dot in the markers margin (Debugging)#D9534F
execution, execution-textThe debugger: the background and the text of the line where the program stoppeda dim yellow; the text color
vcs-added-text, vcs-changed-text, vcs-deleted-textThe text of those lines in the popup over the barthe text color
compiler-errorCompiler tab: the icon and the word "error" of a line with an error; also a file with errors in the Documents and Files lists, a failure in the Status tab, the word "error" in the Messages tab's repair lines, and an error at the top of the tooltip over a nameerror-indicator
compiler-warningCompiler tab: a line with a warning; also a file with warnings in the Documents and Files lists, and a warning at the top of the tooltip over a namechange-modified
compiler-noteCompiler tab: a line with a note; also a note at the top of the tooltip over a nameA mix of background and text at 60%
compiler-successCompiler tab: the icon of a build that ended wellchange-saved
tab-attentionThe label of a message window tab that needs attention (section 10)compiler-warning
tab-runningThe label of a tab whose command, build or search is running#3D8EE0 (blue)
tab-successThe label of a tab whose work ended wellcompiler-success
tab-failureThe label of a tab whose work failedcompiler-error

[syntax]: each kind of token (every key is a style)

"Plain" means the plain text color on the editor's background, neither bold nor italic. The Markdown notes apply to Markdown files; see Languages for how other languages map their tokens to these keys.

KeyWhat it colorsIf left out
commentA block commentPlain
comment-lineA line comment (//)comment
comment-docA documentation comment (/** or /*!)comment
comment-line-docA documentation line comment (/// or //!)comment-doc
numberA numberPlain
stringA string, and a header name in #include; in Markdown, a link's addressPlain
characterA character constant; in Markdown, an escape such as \*string
string-eolAn unterminated string or character. Its background is also drawn under any other unterminated token, such as a comment with no end. A - foreground keeps the string's color.Only a background: a mix of background and brace-bad's color at 22%
keywordA statement word: if, return, static ...; in Markdown, a task box [ ] and a quote kind such as [!NOTE]Plain
typeA type word: int, char, unsigned ...keyword
constantA constant word of the language: true, NULL, None ...; in Markdown, a done task [x], ^sup^ and ~sub~keyword
builtinA builtin word of the language: print, len, echo ...keyword
attributeAn attribute: @decorator, @Override, #[derive], the name of a markup attribute ...; in Markdown, a code fence's language and a link's titlepreprocessor
regexA regular expression literal: /x+/, m{x}, %r(x); in Markdown, $math$ and $$ blocksstring
variableA variable marked by a sigil: $x, @x, ${x}, %x%identifier
tagA markup tag: <div>, </p>, />keyword
entityA markup entity: &amp;, &#10;constant
headingA heading: # Title, or a title underlined with ===keyword
emphasis*emphasis*, _emphasis_Plain, in italic
strong**strong**, __strong__Plain, in bold
linkA link: the text of [text](url), <url>, https://.... Also the color of every place you can click to go to in the panels (section 9).[names] function
codeCode inside text: `code`, a fenced block in a language Unryu does not know, CDATAstring
insertedA diff's added line (+)string
deletedA diff's removed line (-), and ~~struck~~ textpreprocessor
changedA diff's @@ position and its file lines; in Markdown, ==marked== textnumber
preprocessorA preprocessor directive line; in Markdown, the --- lines around front matterPlain
operatorPunctuation and operatorsPlain
brace{ } ( ) [ ]operator
identifierA name that Unryu's code analysis does not knowPlain

[names]: each kind of name the analysis knows (every key is a style)

These colors come from Unryu's understanding of the code, not from the words alone; see Analysis.

KeyWhat it colorsIf left out
localA variable declared inside a block[syntax] identifier
globalA variable at file scopelocal, with its color moved 45% of the way toward function's color
parameterA function parameterlocal
functionA function[syntax] identifier
type-nameA typedef name[syntax] type
tagA struct, union or enum tagtype-name
memberA member of a struct or union[syntax] identifier
enumeratorAn enumerator (a constant of an enum)[syntax] identifier
labelA goto label; in Markdown, a link's [label] and a [^footnote][syntax] identifier
macroA macro[syntax] preprocessor

[declared]: a name at the place where it is declared (every key is a color)

At the spot where a name is declared, Unryu draws a background under it, so you can see declarations at a glance. Each kind of name from [names] has two keys here: the background, and the text on it.

KeyWhat it colorsIf left out
local, globalThe background under a variable where it is declaredA mix of background and [editor] selection at 16%
parameter, function, type-name, tag, member, enumerator, label, macroThe background under a name of that kind where it is declaredA mix of background and the name's own [names] color at 16%
local-text, global-text, parameter-text, function-text, type-name-text, tag-text, member-text, enumerator-text, label-text, macro-textThe name's text on that background; syntax keeps its normal colorThe name's own [names] color

[marks]: braces and the marks over the text

Analysis explains what each of these marks means. brace-good and brace-bad are styles; all other keys are colors.

KeyWhat it colorsIf left out
brace-goodThe brace at the cursor and its partner when the pair is certain; the style's background goes under the pairThe window theme's [app] brace-certain color, or else the window theme's "valid" color; drawn in that color over a 35% tint of it
brace-badA brace at the cursor that has no partner. Its foreground is also the color of a flashing ghost brace.The window theme's [app] brace-missing color, or else its "invalid" color; drawn over a 30% tint of it
pair-likelyThe background under the brace at the cursor and its partner when the pair is likely but not certainA 35% tint of the window theme's [app] brace-likely color, or else a mix of background and amber (#F2CC40) at 35%
pair-likely-textThose bracesbrace-good's color
pair-ambiguousThe same, when the pair is ambiguousA 35% tint of the window theme's [app] brace-ambiguous color, or else a mix of background and orange (#FF8C26) at 35%
pair-ambiguous-textThose bracesbrace-good's color
pair-rangeThe range of text where the partner of an uncertain brace can beA mix of background and selection at 22%
pair-range-textThe text in that rangesyntax
ghostA missing brace, shown where it certainly belongsA mix of background and brace-good's color at 75%
ghost-guessA missing brace, shown where it most likely belongsA mix of background and text at 45%
occurrenceThe background under each use of the name at the cursorA mix of background and selection at 45%
occurrence-textThe text of each usesyntax
search-markThe background under each match of Search > Mark; also the background of the found text in the Messages tabA mix of background and [syntax] number's color at 35%
search-mark-textThe text of each matchsyntax
open-elsewhereThe background under a name or header that is declared in a file open in another tabA mix of background and [names] type-name's color at 20%
open-elsewhere-textIts textsyntax

7. Backgrounds and the text on them

Every color that Unryu draws as a background has a matching key for the text drawn on it, so you can always keep the text readable. Most of these pairs are named key and key-text; a few older pairs in [editor] have their own names. In a style key ([syntax], [names], brace-good, brace-bad) the two colors are the first two parts of the one value.

Background keyText keyCan the text key be syntax?
backgroundtextNo
selectionselection-textNo
current-linecurrent-line-textYes
line-numbers-backgroundline-numbersNo
fold-marginfold-markerNo
marker-marginmarkerNo
tooltiptooltip-textNo
[declared] kind[declared] kind-textYes
pair-likely, pair-ambiguous, pair-range, occurrence, search-mark, open-elsewhereThe same name with -textYes
A style's second partA style's first part- gives the plain text color

Bold and italic always come from the token's own style. A -text key changes only the color.

8. How fallbacks work

When Unryu loads a theme, it fills in every key the theme left out. It does this in a fixed order, so that each fallback is made from keys that are already settled: first the editor view, then the tokens, then the names, then the declaration backgrounds and the marks. The result is that a short theme still gets a full, consistent set of colors derived from its own background, text, selection and syntax colors.

1. [editor] background, text first; the others copy or mix those two 2. [syntax] a kind copies its parent: character from string, brace from operator 3. [names] type-name from type, macro from preprocessor, link from function 4. [declared], [marks] a faint tint of the name's, selection's or brace's color over the background Window theme: [app] brace keys, then its valid and invalid colors Each box uses only keys settled in the boxes before it. The exact fallback of every key is in the tables of section 6.
The order in which missing keys are filled in. Brace colors that the editor theme leaves out come from the window theme.

Brace colors from the window theme

Four brace keys look at the window theme before they use their own fallback. A window theme can set them in its [app] section:

Window theme key ([app])Editor theme key it fillsIf the window theme does not have it
brace-certainbrace-goodThe window theme's "valid" color (the border of a field whose value is valid)
brace-missingbrace-badThe window theme's "invalid" color
brace-likelypair-likelyThe amber fallback in section 6
brace-ambiguouspair-ambiguousThe orange fallback in section 6

The shipped editor themes set all four keys themselves, so this only matters for a theme you write that leaves them out.

9. How the editor theme colors the panels and dialogs

One background for the main window and the dialogs

A window theme has two background colors: window, and the background of the menu bar ([menubar] background). The menu bar, toolbar, panel headers and tab bars use the menu bar's color, and so that is the color you see around the main window. Unryu gives every dialog the same color, so dialogs match the main window: the dialog's background, its labels, the tab bar of a notebook and the pages of a notebook all use the menu bar's background. This works with every window theme, including your own. Fields, lists and the editor keep their own colors, so they still stand out.

The title bar of a docked panel has a top edge and side edges in the window theme's [toolwindow] titlebar-border color. If that color is almost the same as the bar itself, the edges are drawn in the window theme's header-border color (the line under the bar) instead, so the title bar stays visible.

Panels that use the editor theme

The Symbols list, the Documents list, the Files list, the message window's lists and Details all have the editor theme's background, selection and border instead of the window theme's, so a color is as easy to read there as in the code. A thing has the same color in every place that shows it. "Quiet" in the table means a soft color between the text and the background, used for things of less importance.

PanelPartColor
SymbolsA name, and its iconThe [names] color of its kind (a variable always takes local, also at file scope)
A group heading (bold): Functions, Types, Variables, Macros, Constants, HeadingsThe [names] color of function, type-name, local, macro, enumerator and label
A line number; the count after a groupQuiet
The symbol that holds the cursorDrawn on current-line (or a light tint if the current line is turned off)
DocumentsA file with unsaved changes (bold)change-modified
A file in which the last build found an error or a warningcompiler-error, compiler-warning
A folderQuiet
FilesA header; source code; a build file; a document; settings and data; a picture, archive or programpreprocessor; keyword; attribute; string; [names] type-name; quiet
A file that is open (bold); with unsaved changes; with an error or warning from the last buildIts kind's color; change-modified; compiler-error, compiler-warning
Status tabThe time; a path; a line that reports a failureQuiet; link; compiler-error
Compiler tabThe path; the line and column; the word error, warning or note (bold) and its icon; the commandlink; quiet; compiler-error, compiler-warning or compiler-note; quiet
The icon of a build that ended wellcompiler-success
Messages tabThe path; the line; the text that the search foundlink; quiet; on search-mark, in search-mark-text
DetailsA heading; the kind in a heading; a line number you can clickkeyword; the kind's color; link
The counts of the fileThe kinds' colors; the braces in brace-good, pair-likely, pair-ambiguous, brace-bad

Two rules keep these colors readable whatever theme you choose:

On a selected row, all the text has the selection's text color. In the Messages tab, if search-mark-text is syntax (its fallback), the found text is drawn in the plain text color; if the result is too close to search-mark, it is drawn in black or white instead.

Other places that use the editor theme

10. Label colors of the message window tabs

When a tab of the message window is not in view, its label changes color to tell you what happened there. The color goes away when you show the tab.

KeyCompiler tabMessages tabTerminal tab
tab-running (blue)A build is runningA Find in Files search is runningA command is running
tab-success (green)The last build ended well with no warningsThe last search found matchesThe last command succeeded
tab-attention (amber)The last build ended with warningsNot usedText typed at the shell's prompt has not been sent yet (also while the tab is in view)
tab-failure (red)The last build failedNot usedThe last command failed

The Terminal tab learns these states from the terminal's shell integration; with shell integration turned off, the Terminal tab's label never changes color. The colors in brackets are the fallbacks; each theme can set its own.

11. Writing your own color scheme

  1. Open your theme folder, ~/.config/unryu/editor_themes/. It already holds a copy of every shipped theme.
  2. Copy the theme closest to what you want to a new file, for example My Night.conf, or start an empty file.
  3. Set name in [theme] to a new name, for example name = My Night. If you keep an existing name, your file replaces that theme in the lists. Add a description if you like; it is shown under the list in the Color Schemes dialog.
  4. Change the keys you want, using the tables in section 6. Delete any key you do not care about: it will take its fallback, which is usually derived from your other colors.
  5. Choose it with View > Change Color Scheme.... The theme folders are read again each time that dialog or Preferences opens, so a new file is in the list at once.
  6. To see later changes to the file, open Edit > Preferences and press Apply, or choose another scheme and then yours again. Unryu reads the file again each time.

A small but complete dark scheme:

[theme]
name = My Night
description = A short dark scheme: everything else comes from the fallbacks

[editor]
background = #1B1F27
text = #D0D4DC
selection = #34405A
current-line = #222733

[syntax]
comment = #6A7385 - italic
keyword = #C792EA - bold
type = #82AAFF
string = #C3E88D
number = #F78C6C
preprocessor = #89DDFF

[names]
function = #FFCB6B
macro = #89DDFF - bold

[marks]
brace-good = #FFFFFF #2E5E3A bold
brace-bad = #FF5370 #4A2230 bold

In this example, character, regex and code take the string color; constant, builtin, tag and heading take the keyword style; type names and tags take the type color; Markdown links take the function color; the margins take the editor background with the text color for line numbers; and the declaration backgrounds, uses of the name at the cursor and search marks are faint tints made from your own colors.

You can remove a theme by deleting its file from your folder. A theme that also exists in the shipped folder then shows the shipped version again.

12. The window theme file

A window theme is a .conf file with a [theme] name, a [colors] section of roles, and optional sections that override single widget keys. A role that is left out is derived from the others. A window theme is listed and stored under its file name without .conf; the [theme] name inside the file does not change what the lists show. When the theme named in unryu.conf matches no theme exactly, a theme whose name differs only in upper and lower case is used.

A color in a window theme can be written in any of these forms: #RGB, #RRGGBB, #RRGGBBAA (the last two digits are the opacity), RRGGBB without the #, rgb(38, 38, 41), rgba(38, 38, 41, 0.5), and the names white, black and transparent. Lines can be of any length. (An editor theme takes only #rrggbb and #rgb, as section 5 says.)

[theme]
name = Dark

[colors]
window = #262629
window-text = #E0E0E0
base = #2E2E33
accent = #4D99E6

[button]
background = #333338
hover-background = #404045

[app]
brace-certain = #50AA15
Role in [colors]What it colors
window, window-textWindow backgrounds, and the text on them
base, base-textFields, lists and text views, and the text in them
button, button-textButtons, combo boxes, tabs and headers, and their text
borderBorders and frames
accent, accent-textSelection, focus, checked boxes, a slider's fill, and the text on the accent
hoverWhat the pointer is over
activeSomething pressed or open: a pressed button, an open menu or combo box
mutedSecondary text, line numbers and icons
linkLinks
valid, invalidA value that checks out, and one that does not (also the brace fallbacks in section 8)
tooltip, tooltip-textTooltip backgrounds and their text (the tooltip over a name uses the editor theme instead)

The other sections, such as [button], [menu], [menubar] and [toolwindow], set individual widget colors over the roles. Menus, both the menu bar's and the right-click menus, have a frame one pixel wide, round corners and some space inside the frame. In the built-in themes, the menu item under the pointer has an outline in the accent color ([menu] hover-border). The [app] section holds a program's own keys; the only ones Unryu reads are the four brace keys in section 8. The easiest way to make a window theme is to copy one of the built-in themes in ~/.config/unryu/themes/ and change it. A new file appears in the lists the next time View > Change Theme or Preferences opens. A built-in window theme you delete is written again at the next start.

13. Notes