ReSharper 2024.2 Help

Color assistance

ReSharper provides a set of features that help you work with color definitions in your code.

Any color value in the editor has the corresponding color icon, no matter how the color is defined. When you hover over the color icon, you can check the color value in other formats:

Color assistance

Colors are also visualized in the completion list:

Colors in the completion auto-popup

Whenever you see a highlighted color definition, you can change it using the dedicated visual editor.

Change a color definition

  1. Place the caret at a highlighted color definition.

  2. Press Alt+Enter and select Pick color from palette from the action list.

  3. In the Select Color dialog, you can choose colors using three models: AHSB, Web, and ARGB. If you know the numeric value of the color you want, you can enter it into the appropriate text field. You can use the color slider and the color field to choose a color. As you adjust the color using the color field and color slider, the numeric values are adjusted accordingly. When you select a color in the color box, it simultaneously displays the numeric values for AHSB and ARGB, and hexadecimal numbers.

    Changing color definition in C# with a visual editor
  4. You can also click Pick color from some point on screen ThemedIcon.ColorSelection16x16.Screen.(Gray).png and pick a color from any of your running desktop applications.

  5. Click OK to apply the selected color and close the dialog.

By default, ReSharper highlights color usages, but you can turn this off by clearing the Highlight color usages checkbox on the Code Inspection | Settings page of ReSharper options.

This feature is supported in the following languages and technologies:

Language: C#

Language: VB.NET

Language: C++

Language: HTML

Language: ASP.NET

Language: Razor

Language: JavaScript

Language: TypeScript

Language: CSS

Language: XML

Language: XAML

Language: Resx

Language: Build Scripts

Language: Protobuf

Language: JSON

Feature is available in C#

Feature is available in Visual Basic

Feature is not available in C++

Feature is available in HTML

Feature is available in ASP.NET

Feature is available in Razor

Feature is not available in JavaScript

Feature is not available in TypeScript

Feature is available in CSS

Feature is not available in XML

Feature is available in XAML

Feature is not available in Resource files

Feature is not available in build script files

Feature is not available in Protobuf

Feature is not available in JSON

The instructions and examples given here address the use of the feature in C#. For more information about other languages, refer to corresponding topics in the ReSharper by language section.

Last modified: 25 September 2024