I really liked the Monokai color theme, except for one thing - I can barely see the comments which are more than half the actual code text. Is there a way to change the color of the comments specifically but keep the rest according to monokai?
-
1what do you mean by notes?Dimitris Fasarakis Hilliard– Dimitris Fasarakis Hilliard2015-09-19 12:21:02 +00:00Commented Sep 19, 2015 at 12:21
-
in python the char '#' starts a note. In monokai they are gray and the background color is dark gray is they are almost invisible.user2705411– user27054112015-09-20 20:56:40 +00:00Commented Sep 20, 2015 at 20:56
-
2Ah I see, you mean comments!Dimitris Fasarakis Hilliard– Dimitris Fasarakis Hilliard2015-09-21 02:32:53 +00:00Commented Sep 21, 2015 at 2:32
5 Answers
Those are the steps:
open the command palette in sublime text by typing: Ctrl+Shift+P
type: control install package
restart sublime text
Reenter again into the command palette by typing the same thing again
type prv and search for: PackageResourceViewer- Open resource
Click on: Color Scheme - Default and choose Monokai.tmTheme
When you enter the .xml file. go to line 54 I think (under the comment line) and change that value to whaterver you want
For me i use: #26E372 // is a green color For yellow color you can use: #FFFF00
If you want to know wich number to choose: you can go to this site to know: http://tmtheme-editor.herokuapp.com/#!/editor/theme/Monokai
2 Comments
I was unable to change comments color by editing Monokai.tmTheme.
For Sublime 3.1.1 Build 3176 editing Monokai.sublime-color-scheme works.
1. Open Package Resource Viewer
2. Open Color Scheme
3. Open Monokai color scheme
4. Add your desired color in variables (pick here)
5. Change comment color
6. Enjoy your new comments color!
3 Comments
""" my comment here """. I'm not sure what that style of comment is called.# regular comments and """ multiline comments""" it seems.Changing specific components of a color scheme in Sublime Text 3 is easily done via the PackageResourceViewer plugin.
In simple steps:
- Install PackageResourceViewer as you would any plugin via Sublimes Package Manager.
- Open the command pallette and search for ''Open Resource''.
- From the list select Color Scheme - Default and then select the monokai theme Monokai.tmTheme.
From the .xml file scroll down until you see the comment entry holding the color value for the comments and change it to #FFFFFF as it can be seen in the picture:
Now comments will actually be more visible :-)
Of course you can change this value to whatever you wish.
Comments
Adding on to Dschang123's great answer: to distinguish between single- and multi-line comments and their respective colors (which is what I personally came to this question searching for) one can change:
{
"name": "Comment",
"scope": "comment",
"foreground": "var(yellow5)"
},
to instead read:
{
"name": "Comment_multi",
"scope": "comment.block, punctuation.definition.comment.block",
"foreground": "var(blue5)"
},
{
"name": "Comment_single",
"scope": "comment.line, punctuation.definition.comment.line",
"foreground": "var(blue6)"
},
(I like these colors for the Mariana theme but am not advertising my choice as optimal by any metrics).
Information on "scope" from: https://www.sublimetext.com/docs/3/scope_naming.html
(I'd comment this under Petr Javorik's answer in response to Gabriel Staples's comment, but my rep doesn't yet qualify to comment.)
Comments
Based on the answer by @jbplasma, for Monokai theme in Sublime Text Build 4126 I went to the menu option Preferences -> Customise colour scheme and filled out the right-hand pane of custom settings to contain this:
// Documentation at https://www.sublimetext.com/docs/color_schemes.html
{
"variables":
{
"dimcomment": "hsl(60, 12%, 55%)",
"brightcomment": "hsl(60, 12%, 75%)",
},
"globals":
{
},
"rules":
[
{
"name": "Comment_multi",
"scope": "comment.block, punctuation.definition.comment.block",
"foreground": "var(brightcomment)"
},
{
"name": "Comment_single",
"scope": "comment.line, punctuation.definition.comment.line",
"foreground": "var(dimcomment)"
},
]
}
This brightens up both block and line comments, making block comments a little lighter. You can change the brightness by adjusting the last percentage value, luminance, in the hsl() tuples.







