[ANN] Color Browser 0.1.0-5x

I've just posted a new plugin called Color Browser. It's similar to ColourChooser but it has much more functionality. If you do any work with colors in Java code or CSS/HTML files you may want to take a look.

Here is the contents of the README:

NOTE: This version requires IDEA to be executed with JDK 1.5.0 or greater.

+ Color Browser

This plugin allows you to see colors used in Java code and CSS/HTML files. You may also picks colors and insert one of several representations of that color in the current editor.

++ Installation

Use IDEA's plugin manager to install the latest version of the plugin.

++ User Interface

Simply open the Color Browser tool window to begin using the plugin. The interface includes a color chooser with several methods of picking a color. As a color is selected a series of buttons are updated with different representations of the color. Clicking on a button inserts the text of the
button label in the current editor. If the editor has a selection, the contents of the selection are replaced.

+++ Color Information

In the upper left corner is a large rectangle showing the selected color along with its RGB, HSB, and HSL representations.

+++ Java Color

Below the color information is a column of buttons. These button represent the various java.awt.Color contructors that can be used to created the selected color. The last button shows one of the java.awt.Color color constants. If the selected color doesn't have a predefined constants then the button is disabled.

+++ CSS/HTML Colors

The top right section contains a column of buttons to be used in CSS and HTML files. Each button represents one of the supported color formats as defined in CSS Level 3. The last button is for a SVG color name. This button is disabled if the selected color doesn't have an associated SVG name.

+++ Cursor

Pressing the Cursor button will look at the text around the cursor in the current text editor. If the text represents one of the supported color representations the color will be selected in the tool window.

+++ Color Chooser

The color chooser contain several tabs for selecting a color in different ways. The current methods are:

  • Color Swatches

  • HSB (Hue, Saturation, Brightness)

  • RBG (Red, Green, Blue)

  • HSL (Hue, Saturation, Lightness)

  • Hex (Red, Green, Blue)

  • SVG Colors (drop down list)

  • Java Color Constants (drop down list)


+++ Editors

Pressing and holding down the Ctrl key while moving the mouse cursor around in an editor will display a hyperlink and information window whenever the cursor is over any valid color representation in one of the supported formats.

Clicking the left mouse button while a link is displayed will perform the same function as pressing the Cursor button with the caret in the same location as the mouse click.

5 comments
Comment actions Permalink

I just released 0.1.0-6x for Demetra due to a slight API change.

Enjoy,
Rick

0
Comment actions Permalink

Hi Rick,

interesting plugin but there are some possible improvements that would make it more useful:

  • Support for javax.swing.plaf.ColorUIResource : Currently the plugin doesn't recognize ColorUIResources as colors and is therefor not as useful to look and feel developers as it could be.

  • Could the "Cursor" button become a toggle button. The plugin would then have to always display the color under the cursor.

  • The button should replace the color under the cursor on not create a new color creation statement at the cursor's postion. Maybe it could be like that: If the cursor is inside a color creation statement, replace that statement, otherwise create a new one.

  • The mass of the color buttons are a bit irritating. Most likely I want to choose one color format and use it everywhere in a project. So maybe a combobox to choose the color fromat from and just one button that represents the current color in the chosen color format would be better. The way it is now I always have to relocate the right button every time I want to change or create a new color.


Cheers,
Robert

0
Comment actions Permalink

Robert,

I will look into ColorUIResource. I've never done anything with L&F before.

Cursor as a toggle button: There is already a better way that does what you want (I believe). Hold down the Ctrl key while you move the mouse around. Each time you move over a color representation a color popup will appear showing basic color info. If this is a color you want then Ctrl-Click on it. This will populate all the buttons just as if you had pressed the Cursor button.

Text replacement: I like your idea of the plugin being smarter on text replacement. I will look into that. In the meantime if you select all of the current color text then click on one of the new color buttons the text will get replaced.

Mass of buttons: I agree there are too many. This was the first release to get some feddback. Yours is the first. I was thinking about some sort of preference as you suggest. I will look into some good ways to reduce the button count.

Danke,
Rick

0
Comment actions Permalink

Robert,

I will look into ColorUIResource. I've never done
anything with L&F before.

It's not very complicated ColorUIResource is only a subclass of Color that also implements the tagging interface UIResource.


Cursor as a toggle button: There is already a better
way that does what you want (I believe). Hold down
the Ctrl key while you move the mouse around. Each
time you move over a color representation a color
popup will appear showing basic color info. If this
is a color you want then Ctrl-Click on it. This will
populate all the buttons just as if you had pressed
the Cursor button.

Thanks for the tip. That's nice. One thing though the color popup stays up only very shortly. It only blinks on and off again. CTRL-clicking works without problems.

Keep it up. It's a useful plugin.

Cheers,
Robert

0
Comment actions Permalink

You need to keep holding down the Ctrl key. For me the popup stays up as long as the Ctrl key is pressed, regardless of where you move the mouse after it appears.

Rick

0

Please sign in to leave a comment.