CSInlineColorViz
CSInlineColorViz copied to clipboard
hex constants are too aggressively assumed to represent colors
private const int TV_FIRST = 0x1100;
is shown with a color preview
IMO it shouldn't.
I've seen this a few times in code files and agree that yes, it would be nice if it didn't pick these up, but it's only (for me) something I see occasionally, and so I haven't cared enough to do anything about it.
So, what to do:
- Live with it?
- Apply some clever heuristic to try and determine if it's supposed to be a colour?
- Have a configurable setting where you can opt out of this behaviour?
- Have a configurable setting where you can opt in to see colour indicators on anything that might be a hex representation of a colour?
I don't know in what context a 4-digit hex is a color (unless it's interpreted as 0x001100), so IMHO limit it to 6 or 8 digits, and offer an opt-in for more. And maybe also have an opt-out for all the ints.