5

Is there a way to edit the colors which are set in a color theme for Visual Studio Code? I've installed Cobalt 2 but the colors are slightly different for the same theme in Sublime Text which I was using for the past couple of years. More precisely, I don't like the color of the strings in JavaScript which are white, for some reason:

enter image description here

Is there any way I can change the colors of the selected color theme?

Thanks!

cycero
  • 4,547
  • 20
  • 53
  • 78

3 Answers3

4

Go to file > Preferences > Color Theme (or ctrl+k ctrl+s) and then select the one you like best.

you can have a javascript file open at the moment you try this to see how the colors change in your syntax. I think the theme you are looking for is Monokai.

L Y E S - C H I O U K H
  • 4,765
  • 8
  • 40
  • 57
Carlos Valencia
  • 6,499
  • 2
  • 29
  • 44
  • Thanks, but there's no such an option on Mac. There's a section to chose the color theme, but not edit it. – cycero May 15 '17 at 18:52
  • can you find it under Code > Preferences > Color Theme? – Carlos Valencia May 15 '17 at 18:54
  • 4
    "Code > Preferences > Color Theme" let's you chose a theme, not edit it. – cycero May 15 '17 at 18:55
  • You can Find your theme's json file as suggested in [this question](http://stackoverflow.com/questions/35165362/how-to-edit-default-dark-theme-for-visual-studio-code) and modify the colors you need. in your case find tokenColors and then "name" : "String" and change the foreground color – Carlos Valencia May 15 '17 at 19:07
  • Thanks! If anybody needs it - here's the location of the theme config file on Mac: /Users/[user_name]/.vscode/extensions/kamranmackey.cobalt2-Theme-0.0.3/themes/ - in this particular case this is Cobalt 2. Should be similar for any other. – cycero May 15 '17 at 20:11
  • @cycero - had you tried this one - wesbos.theme-cobalt2-2.0.10 - the string colours are not white by default with this theme (Cobalt2). – arcseldon Aug 31 '17 at 17:22
1
  1. First check the theme your using's description for the hex value of what you want to replace (ex: strings).
  2. Find .vscode/extension/ folder then find the theme json file (might be in another folder called themes) 3.. open it in the text editor
  3. Use replace feature (most text editors have) and put in the hex value you found in the readme and replace it with the hex value of the color you want string to be.

If you want to update the theme description go into the themes readme file and do they same (replace original value with new), then restart vscode.

enter image description here

Roman Mahotskyi
  • 4,576
  • 5
  • 35
  • 68
0

Change colors in a Visual Studio Code color theme by using short keyword:

CTRL+K 
CTRL+S

or you can change it by following these steps:

Step 1: Click File(top right menu)
Step 2: Preferences
Step 3: Click

enter image description here

Rizwan
  • 3,741
  • 2
  • 25
  • 22