Provide colored adornments to hexadecimal color values in Visual Studio.
- Technologies: Visual Studio 2015 SDK
- Topics: Visual Studio Editor, VSX
Description
This sample Visual Studio 2015 extension uses intra-text adornments to replace six digit hexadecimal values with color swatches. These adornments are shown between text characters, as opposed to behind or in front. Intra-text adornments may optionally replace text. The value of the hexadecimal number corresponds to the color of the swatch.
- Red = 0xff0000
- Green = 0x00ff00
- Blue = 0x0000ff
Requirements
Get all samples
Clone the repo (How to):
git clone https://github.com/Microsoft/VSSDK-Extensibility-Samples.git
Run the sample
- To run the sample, hit F5 or choose the Debug > Start Debugging menu command. A new experimental instance of Visual Studio will launch.
- Once loaded, open any file in the text editor.
- Type a six-digit hexidecimal number.
- An adornment is displayed that displays the color value of the hexadecimal number
If you want the color swatch to appear next to the hexadecimal number instead
of replace it, comment out the line #define HIDING_TEXT
in
ColorAdornmentTagger.cs
.
Related topics