name-that-color-intellij-plugin icon indicating copy to clipboard operation
name-that-color-intellij-plugin copied to clipboard

Make plugin work with other Jetbrains IDEs (not just Android Studio)

Open Potherca opened this issue 5 years ago • 5 comments

I love http://chir.ag/projects/name-that-color and this plugin could be awesome... sadly I am not using Android Studio but PHPStorm, so I can't use it :sob:

I have no idea how much work it will be, but would it be possible to create a version of this plugin that works with other IDEs, not just Android Studio?

Potherca avatar Feb 14 '20 09:02 Potherca

Hello @Potherca ,

Sounds doable! All this plugin does to target Android is to add "triggers" in an xml file containing <resources></resources> tags.

On what platform/language are you working on and how are colors defined in your project?

galex avatar Feb 19 '20 13:02 galex

I use PHPStorm (WebStorm is similar). Colors occur mostly in CSS, Sass (CSS) or Less files. They occur as values to keys like:

color: #00FF00;

There is all sorts of functionality related to color in CSS files (and similar) but no way (that I know of) to add/convert to "name that color".

Potherca avatar Feb 19 '20 18:02 Potherca

Can you show me an example of how you define and use named colors in css?

galex avatar Feb 24 '20 06:02 galex

Ping @Potherca :)

galex avatar Jun 16 '20 18:06 galex

Sorry about the delay, with the whole Corona thing going on and changing jobs to join @pdsinterop, this got shuffled to the bottom of the deck.

CSS defines values for properties, for instance, if I want an HTML page to be red with white letters, I would define:

    body {
        color: #FFF;
        background-color: #F00;
    }

Instead of #F00 I could also use rgb(255, 0, 0);, hsl(0, 100%, 50%); or simply red.

All available colors are listed at MDN

There is a UI element in PHPStorm that provides some functionality:

phpstorm

(Image taken from the PHPStorm manual entry on stylesheets)

Changing jobs also meant changing laptops. Currently I am working mostly in Cloud9 IDE and VSCode.

As soon as I have PHPStorm installed and set up, I could add some examples and screenshots for futher clarity if needed...

Potherca avatar Jun 25 '20 18:06 Potherca