// Package theme turns TOML colour files into the tcell styles the editor // draws with. // // A theme is a flat map from a dotted style key, such as "syntax.keyword", to // a foreground colour, a background colour and a few attributes. Lookups fall // back along the dots, so a theme that only defines "syntax" still colours // every token, and one that defines nothing still renders. // // Themes ship embedded in the binary and are also read from the user's // configuration directory, where a file of the same name wins. package theme // The style keys the editor asks for. A theme need not define them all: // Style falls back along the dots and finally onto KeyDefault, so a partial // theme is a usable theme. // // Keys are grouped by the widget that draws with them. Adding a widget means // adding its keys here, so that this list stays the single description of what // a theme file may contain. const ( // KeyDefault is the last resort of every lookup. KeyDefault = "default" // The desktop is the patterned backdrop behind every window. KeyDesktop = "desktop" // KeyShadow is the dimmed cells a window casts to its bottom right. KeyShadow = "shadow" KeyMenuBar = "menu.bar" KeyMenuItem = "menu.item" KeyMenuSelected = "menu.selected" KeyMenuShortcut = "menu.shortcut" KeyMenuDisabled = "menu.disabled" KeyWindowFrameActive = "window.frame.active" KeyWindowFrameInactive = "window.frame.inactive" KeyWindowTitleActive = "window.title.active" KeyWindowTitleInactive = "window.title.inactive" KeyWindowBody = "window.body" KeyStatusBar = "statusbar" KeyStatusBarKey = "statusbar.key" KeyStatusBarHint = "statusbar.hint" KeyScrollBar = "scrollbar" KeyScrollBarThumb = "scrollbar.thumb" KeyDialogFrame = "dialog.frame" KeyDialogBody = "dialog.body" KeyDialogTitle = "dialog.title" KeyDialogLabel = "dialog.label" KeyButton = "button" KeyButtonFocused = "button.focused" KeyButtonShortcut = "button.shortcut" KeyInput = "input" KeyInputFocused = "input.focused" KeyInputSelection = "input.selection" KeyList = "list" KeyListSelected = "list.selected" KeyListUnfocused = "list.unfocused" KeyCheckbox = "checkbox" KeyCheckboxFocused = "checkbox.focused" KeyEditorText = "editor.text" KeyEditorSelection = "editor.selection" KeyEditorLineNumber = "editor.linenumber" KeyEditorCurrent = "editor.currentline" // KeyEditorCursor colours the cell the cursor is on. It must contrast with // editor.currentline whichever way round the terminal draws its own cursor. KeyEditorCursor = "editor.cursor" // KeyTerminalText is the default colour of a terminal window's contents, // used wherever the program running in it has asked for none of its own. KeyTerminalText = "terminal.text" // KeyTerminalCursor colours the cell the shell's cursor is on. KeyTerminalCursor = "terminal.cursor" // KeyTreeText is a file's name in a project tree, and the tree's own // background. KeyTreeText = "tree.text" // KeyTreeDirectory is a directory's name, which wants to stand out from // the files beside it. KeyTreeDirectory = "tree.directory" // KeyTreeSelected is the highlighted row of a focused tree. It cannot be // borrowed from the list group: a dialog's list sits on a dialog, and // list.selected is coloured to stand out against that rather than against // a window's body. KeyTreeSelected = "tree.selected" // KeyTreeUnfocused is the highlighted row of a tree that does not have the // keyboard, so a screenful of windows still says where typing would go. KeyTreeUnfocused = "tree.unfocused" KeySyntaxKeyword = "syntax.keyword" KeySyntaxType = "syntax.type" KeySyntaxBuiltin = "syntax.builtin" KeySyntaxConstant = "syntax.constant" KeySyntaxFunction = "syntax.function" KeySyntaxString = "syntax.string" KeySyntaxChar = "syntax.char" KeySyntaxNumber = "syntax.number" KeySyntaxComment = "syntax.comment" KeySyntaxOperator = "syntax.operator" KeySyntaxPunctuation = "syntax.punctuation" KeySyntaxIdentifier = "syntax.identifier" // The classes that only the markup languages produce. Go has nothing that // reads as a heading or a tag, so these appear in Markdown and HTML only. KeySyntaxHeading = "syntax.heading" KeySyntaxTag = "syntax.tag" KeySyntaxAttribute = "syntax.attribute" KeySyntaxEmphasis = "syntax.emphasis" KeySyntaxLink = "syntax.link" KeyCompletionFrame = "completion.frame" KeyCompletionItem = "completion.item" KeyCompletionSelected = "completion.selected" KeyCompletionDetail = "completion.detail" KeyDiagnosticError = "diagnostic.error" KeyDiagnosticWarning = "diagnostic.warning" KeyDiagnosticInfo = "diagnostic.info" )