Color chooser in editor available for java code?
I have a color chooser popup available when changing stylesheets. Is this somehow available in Java code as well?
Eg. When you have a statement like this: new Color(255, 243, 243) it would be nice to have a color chooser available.
If not available currently it would be nice for a short pointer how to make a plugin for this.
Thanks
Thomas
请先登录再写评论。
I believe, Color Browser plugin used to support it, but it seems to have been abandoned for a long time.
It is available as an intention in the 10 EAP releases at least (I don't
have 9.x installed to test sorry). Alt+Enter -> Choose Color.
Ah, I see... I did not know it has made its way into core IDEA, even though it's been around for a few years now. Probably because it does not actively manifest itself. Here's what looks like the original request for it:
http://youtrack.jetbrains.net/issue/IDEA-39636
It would be nice if they put colour preview samples in the left gutter, much like they do it for CSS (or for images in java files).
And a support for transparency and different colour representations in the constructors of Color and ColorUIResource would be nice too.
I guess a bunch of youtrack items is due...
http://youtrack.jetbrains.net/issue/IDEA-62528
http://youtrack.jetbrains.net/issue/IDEA-62527
http://youtrack.jetbrains.net/issue/IDEA-62530
http://youtrack.jetbrains.net/issue/IDEA-62531
I agree, thanks for submitting the issues. Note that one thing you can do
currently is hold down the Shift key and hover the mouse over the color to
get a popup preview of the color. Better than nothing but previews in the
margin would be much friendlier. It's a surprising omission given the icon
previews that already exist.
Thanks for your hints. Indeed it was probably there already for along time. The only problem I had, I did never realize intentions are related to this kind of "helpers". I saw intentions to be more code structure/refactoring related than these kind of tasks. But you never will stop to learn. ;)
Have a nice day
Thomas
It is another feature that can probably only be discovered accidentally. I've never realised it existed. There should probably be a hint in the status bar telling you that you can Shift+hover for colour preview.