CSInlineColorViz icon indicating copy to clipboard operation
CSInlineColorViz copied to clipboard

Feature Request: Support previews for strings holding hex values

Open alm-ampler opened this issue 11 months ago • 2 comments

Hi,

I came across your extension and it looks really good.

I don't know if this would be possible, but I do a lot of debugging where I pull out the colour to check if its the correct one.

So it looks like this IDE wise:

Image

Would it be possible to have a preview of the colour on the right, like in the examples?

(Like this, although I dont actually know if that hex corresponds to that colour 🤷

Image

If not, feel free to close 😄

I havent tried the extension without resharper, so please let me know if its supposed to work out of the box.

alm-ampler avatar Feb 11 '25 11:02 alm-ampler

Hi @alm-ampler, this extension is intended to show colour values in the source code at design time.

I would often have to work with code that used a color name and I could never remember what "Gainsboro" or "Chartreuse" meant. (variations of grey and lime green) and I didn't want to have to work out what a hard coded HEX value was.

So as per the below image, it displays these little color indicators in C# source code. Visual Studio has a similar capability built in for .XAML files but this adds it for .cs and razor files.

example

What I think you're talking about (asking for) is a debug visualizer. This extension does not offer that. I'm not saying it couldn't, just that I currently have no plans to add this functionality. I know it's possible and there are new ways of making such visualizers although slightly different to what you're asking for.

I like the idea of adding the capability you describe but my past attempts at creating debug visualizers proved it was harder than I expected. (I haven't tried the new APIs.)

I'm happy to leave this issue open on the "back burner" to see if anyone else is interested in this capability but I make no commitment to ever adding it. Alternatively, I'm happy if you want to close this.

mrlacey avatar Feb 11 '25 12:02 mrlacey

Thanks for responding so quick!

Yes, thats exactly what I need for this bit - although I will keep using the extension for things like you mention because I do work with WPF :)

I will look and see if one exists. I can totally understand not wanting to fight with more Microsoft APIs :D

Up to you to close it if you want - either is fine with me.

Appreciate your time!

alm-ampler avatar Feb 11 '25 14:02 alm-ampler