12

Every once in a while, Visual Studio decides to mess up my colors.

This is what happens:

visual studio broken colors

It should look like this:

good colors visual studio

I'm not sure what is causing this, but I hope someone else has experienced this before and was able to fix it.

jao
  • 1,920
  • 9
  • 26
  • 40

8 Answers8

7

Check this question at StackOverflow:

Basically the person asking the questing figures out himself that there is a plug-in overriding the colour settings. My tip would be to check any plug-ins you have installed and see if they have any font or colour settings

Also found this link although I don't know if it's really related.

Glorfindel
  • 4,089
  • 8
  • 24
  • 37
Qw4z1
  • 271
  • 1
  • 3
  • 8
  • From the screenshots, it doesn’t look like Jao has VAX installed. – Synetech Mar 09 '12 at 19:59
  • No, but I figured this problem is probably not isolated to VAX, but applies to other plug-ins able to mess with the color setup. – Qw4z1 Mar 09 '12 at 22:20
  • If plugins mess with syntax-coloring without making it obvious to the user (and providing an easy way to disable it), then that’s a bad plugin indeed—especially since anyone using VS is likely smart enough to figure out how to access the plugin’s settings. – Synetech Mar 09 '12 at 22:22
4

I had the same issue and I just changed the Color Theme to Blue (Tools > Options > Environment > General > Visual Experience > Color Theme) clicked OK.. then change it back to DARK and all colors went back to normal.

4

It looks like you might be running ReSharper and have "color identifiers" enabled. They are optimized for a white background, I've had the same problem.

To fix go to ReSharper Options: Code Inspection/Settings and disable Color identifiers.

I don't know the reason they switch on and off, but it's probably because other users in your team have them enabled in their ReSharper "settings layer" which you can manage under ReSharper/Manage Options.

Sire
  • 139
  • 4
1

I've encountered this before. I've noticed that this usually occurs after I update an addon or a component.

While this isn't a permanent fix, I suggest that you make a backup of your fonts & colors settings.

  1. Tools > Import and Export Settings...
  2. Select Export selected environment settings
  3. All Settings > Options > Environment > Fonts and Colors (check this option only)
  4. Save the settings file under recognizable name (eg: VimTheme.vssettings)

The next time all your colors get messed up, simply import that settings file and your fonts & colors should be fine.

Derethus
  • 237
  • 1
  • 5
  • It happens quite infrequently, sometimes three or four times a day, and some days everything is fine. After restarting visual studio the colors are OK. So maybe it's a rendering issue, I don't know – jao Mar 06 '12 at 17:38
  • Mmm, you're reminding me of another problem I sometimes get with SQL Management Studio: whenever I move the window from one monitor to another, the entire code area messes up. Whenever that happens, I quickly enter/exit fullscreen (alt+shift+enter twice). I wonder if that would have an effect in your Visual Studio. Probably not, but worth a shot. – Derethus Mar 06 '12 at 19:30
0

I just had to restart Visual Studio to fix it.

Sundeep
  • 101
  • 2
  • This "answer" is identical to one of the comments. – zx485 Dec 02 '19 at 15:30
  • @zx485 Identical to which answer? – Sundeep Dec 02 '19 at 19:41
  • Not to an answer, but rather to one of [the comments on the question of the question owner himself/herself/itself](https://superuser.com/questions/393560/visual-studio-colors-mess-up/1506759?noredirect=1#comment450553_393560) from seven years ago. – zx485 Dec 02 '19 at 19:44
0
  1. Close Visual Studio
  2. Open a registry editor (regedit is sufficient)
  3. Delete the following registry entry:
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\UseDebugColorScheme
  4. Restart Visual Studio
Synetech
  • 68,243
  • 36
  • 223
  • 356
  • that registry key does not exist on my computer – jao Mar 10 '12 at 12:30
  • Too bad; that means some other unknown thing is wrong. `:-(` Perhaps clearing the cache by deleting the key `HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\ThemeColorCache` might help. If not, then try doing a repair install of VS. – Synetech Mar 10 '12 at 16:56
0

From the screenshots, it looks like the same color scheme with a few changes. Have you changed any of the colors yourself, or even just briefly experimented with themes? Did you for example, make a copy of a theme, change a few colors, then cancel?

A screenshot of your Theme menu can help narrow down the problem.

Next time the theme changes, make sure that the correct theme is still selected in the Theme menu. What may be happening is that now and then, you press some key combination or chord that triggers the theme to change (e.g., accidentally opening the Theme menu and pressing a key which corresponds to the other theme), or via a hotkey that specifically changes the theme (you can check this in the keyboard section of the Options dialog).

Synetech
  • 68,243
  • 36
  • 223
  • 356
0

It was hardware related. Switching off hardware acceleration fixed it.

jao
  • 1,920
  • 9
  • 26
  • 40