Visual Studio's Rainbow Colorized Brackets

Visual Studio's Rainbow Colorized Brackets

Rainbow bracket colorization, a popular extension and later core feature of VS Code, is now available as a free Visual Studio extension called Rainbow Braces, created by Mads Kristensen. It was only released last week and currently only supports Visual Studio 2022.

Colorizing brackets makes visually matching opening and closing brackets (or braces, parentheses, or curly brackets) much easier. Here's a simple method that includes an if statement and several sets of nested parentheses:

rainbow-braces-dark.png

The different colours make it easier for (non-colorblind) programmers to match up braces, especially on the same line where vertical spacing and indentation are less useful.

The extension also supports a number of themes. Here's the same code in a lighter colour scheme:

rainbow-braces-dark.png

The extension includes some configuration options, allowing you to toggle whether you want colorization enabled at all, as well as for:

  • curly brackets { }
  • parentheses ( )
  • square brackets [ ]

You can also customize the colors if you don't like the defaults (there are 4 levels of colors you can specify).