Color Schemes (Legacy)
Color schemes define the colors used to highlight source code in Sublime Text views and to style different elements found in the editing area: background, foreground, selection, caret...
WARNING
This document describes the old .tmTheme color scheme (not theme!) format inherited from TextMate.
For the new .sublime-color-scheme format added in Sublime Text 3.1, refer to the official documentation.
Note
Sublime Text differentiates between "color schemes" defining colors in the editor area and "themes" defining the layout for the rest of the UI. Rather confusingly, the color scheme format inherited from TextMate uses the .tmTheme unchanged extension, because themes in TextMate themes are what color schemes are for Sublime Text.
It's important to remember that UI themes and color schemes are two different customization mechanisms. Generally speaking, it is far less complex to create a new color scheme than it is to create a new UI theme.
File Format
| Name | Description |
|---|---|
| Format | Property List |
| Extension | .tmTheme |
| Name | Any |
| Location | Any under Packages |
The file format of color scheme files is inherited from Textmate.
Where to Store Color Schemes
By convention, packages primarily containing a set of color scheme files have the Color Scheme - prefix. For example: Color Scheme - Default.
The file names of all available color schemes are displayed in the Preferences → Color Scheme menu, grouped by the containing package.
Structure of a Color Scheme File
All color scheme files share the same topmost structure.
Colors can be expressed in the following formats: #RRGGBB, #RGB, X11 color names
Most elements controlling colors accept an alpha channel value: #RRGGBBAA.
Root Elements in Color Schemes Files
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<!-- INSERT DICTIONARIES WITH COLOR SETTINGS HERE -->
</array>
<key>uuid</key>
<string>D8D5E82E-3D5B-46B5-B38E-8C841C21347D</string>
</dict>
</plist>nameOptional. Name of the color scheme. Ignored by Sublime Text.
settingsRequired. Container for further color scheme settings. See Sub-elements of Settings for details.
uuidOptional. A unique identifier for the file. Ignored by Sublime Text.
Sub-elements of Settings
Sublime Text supports the following color scheme settings:
Global Settings
Not associated with any scope. These settings affect global visual items in the editing area.
Global settings go inside a <dict> element within the topmost <array>.
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#272822</string>
<key>caret</key>
<string>#F8F8F0</string>
...
</dict>
</dict>
...
</array>General
foregroundDefault foreground color for the view. Affects file contents, the gutter, rulers and guides. The alpha channel does not apply to file contents. Because there is no override setting for rulers, the only way to change the color of rulers is a "hack" further described on CursorRuler's wiki.
backgroundDefault background color of the view (and gutter).
invisiblesIgnored.
caretColor of the caret.
lineHighlightColor of the line the caret is in. Only used when the
higlight_linesetting is set totrue.
Brackets
bracketContentsOptionsControls how brackets are highlighted when a caret is between a bracket pair. Expects a space-separated list of the available options.
Only applied when the
match_bracketssetting is set totrue.Options:
underline,stippled_underline,squiggly_underline,foregroundDefault:
underlinebracketContentsForegroundColor of the highlighting(s) selected by
bracketContentsOptions.Only applied when the
match_bracketssetting is set totrue.bracketsOptionsControls how brackets are highlighted when a caret is next to a bracket. Expects a space-separated list of the available options.
Only applied when the
match_bracketssetting is set totrue.Options:
underline,stippled_underline,squiggly_underline,foregroundDefault:
underlinebracketsForegroundColor of the highlighting(s) selected by
bracketOptions.Only applied when the
match_bracketssetting is set totrue.
Tags
tagsOptionsControls how tags are highlighted when a caret is inside a tag. Expects a space-separated list of the available options.
Only applied when the
match_tagssetting is set totrue.Options:
underline,stippled_underline,squiggly_underline,foregroundDefault:
stippled_underlinetagsForegroundColor of the highlighting(s) selected by
tagsOptions.Only applied when the
match_tagssetting is set totrue.
Find
findHighlightBackground color of regions matching the current search.
findHighlightForegroundForeground color of regions matching the current search.
Gutter
gutterBackground color of the gutter.
gutterForegroundForeground color of the gutter.
Selection
selectionColor of the selection regions.
selectionBorderColor of the selection regions' border.
inactiveSelectionColor of inactive selections (inactive view).
Guides
guideColor of the guides displayed to indicate nesting levels.
Only used if the
indent_guide_optionssetting includesdraw_normal.activeGuideColor of the guide lined up with the caret.
Only applied if the
indent_guide_optionssetting includesdraw_active.stackGuideColor of the current guide's parent guide levels.
Only used if the
indent_guide_optionssetting is set todraw_active.
Highlighted Regions
highlightBackground color for regions added via
sublime.add_regions()with thesublime.DRAW_OUTLINEDflag added.highlightForegroundForeground color for regions added via
sublime.add_regions()with thesublime.DRAW_OUTLINEDflag added.
Shadow
shadowColor of the shadow effect when the buffer is scrolled.
shadowWidthWidth of the shadow effect when the buffer is scrolled.
Values greater than 32 cause the shadow to be hidden. The default is 8.
Note that, despite its nature, this expects a string value.
Scoped Settings
Settings associated with a particular scope.
<array>
...
<dict>
<key>name</key>
<string>Comment</string>
<key>scope</key>
<string>comment</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#75715E</string>
</dict>
</dict>
...
</array>nameDescriptive name of the item.
scopeTarget scope name.
settingsContainer for settings. Valid settings are:
fontStyleSpace-separated list of styles for the font.
Options:
bold,italic, nothing (resets fontStyle to normal)foregroundForeground color.
backgroundBackground color.
Minimal Scope Coverage
Refer to the official Scope Naming guidelines in order to find out which scopes a color scheme should cover at minimum.
Sublime Text Settings Related to Color Schemes
View Settings
color_schemePath to a color scheme file relative to the Data folder (example:
Packages/Color Scheme - Default/Monokai.tmTheme).