So my search-fu must be weak, as I’ve scanned a ton of threads trying to figure out how to customize a color scheme. I’m using the Soda Dark Theme with the Monokai Soda color scheme, but I want to change those colors. Where/how do I do this? In what program?
Modify / Customize Color Schemes
Check here for general information about Sublime, and here for color schemes specifically.
The Monokai syntax theme can be found in Packages/Color Scheme - Default/Monokai.tmTheme . This is an XML file and you can edit it in any editor; ST2 works well because the changes will be applied instantly (barring any syntax errors).
If you have access to Textmate, you can edit the theme there with its GUI, and then copy the theme over to sublime.
Note: we are talking about “color schemes”, such as Monokai, which are “.tmtheme” files.’
“Themes” like Soda Dark, are a different matter. The terminology is completely confusing.
This answer is similar to the accepted solution, but with little more steps if it is not working out of the box. This might help someone if they are stuck with an issue which I have described in one of the below steps.
-
install PackageResourceViewer using Package Control
-
Go to Preferences->Package Settings->PackageResourceViewer->Setting-User. copy paste the following 3 lines,save and close it.
{
"single_command": false
} -
press Ctrl+shift+p to open Package Control and select PackageResourceViewer: Edit Package Resource from the list. Find the package you want to edit and click on it. In my case, I want to edit a theme which is installed via ColorSublime Package, So I selected that theme.
-
Now you will see that the selected package file opened in the sublime editor itself. Edit it as you want and save it and close it. The changes should reflect in sublime editor. In my case, since I changed the theme I need reload it. So I continued with the following steps too.
-
go to view menu select ‘Show Console’ and run following command to reset the theme.
view.settings().erase(“color_scheme”) -
open Preferences->Settings and delete the “color_scheme” attribute and its value from the settings file and close it. Again select the color theme from Preferences->Color scheme. Now you should able to see the changes reflected which you made in the theme package.
Hope this helps!
Error loading package
For example to edit the PHP tags from WHITE to RED in the Monokai Theme, simply add this code into the theme file.
{
“name”: “PHP Tags”,
“scope”: “punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php”,
“foreground”: “#f80000”
}
I also wanted to modify some colours of a colour theme too.
this post was handy as well
For example I installed PackageResourceViewer.
Then crlt+shift+p
PackageResourceViewer:Open Resource
I’d installed the Rainglow colours, but non were exactly what I wanted. Open Resourse will give you a long list of resources so I scrolled down to
Rainglow
(or you can type in the first couple of letters)
then went to rainglow/ and this gave me a list of .tmTheme files.
Select the one you want to edit in my case it was PenitentContrast
When you open the file you should get something that looks a bit like this:
name
Comment
scope
comment
settings
foreground
<string>#00AAFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String</string>
<key>scope</key>
<string>string</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#eac03a</string>
</dict>
</dict>
<dict>
(It’s just a code snippet)
the hex number between the string markers, string>#b9cec7"</string is the colour number. RedGreenBlue each channel going to a max of FF, hence FFFFFF is white, 000000 is black FF0000 red, and 00AAFF a mid bluish/turquiose.
I changed the background (the “color string” at line 24) the comments “color string” at line 70 (ish) to the aforementioned 00AAFF, built in constants (eg true & false in many languages) at roughly line 106.
It’s probably worth commenting the original string before you start messing around so you can go back to the original easily if you wish.
As soon as you save the file, your new colours will be updated.
I was a bit daunted by all this at the beginning, but it’s real easy. Hope this is helpful to someone. Great to have that level of customization.