Git Product home page Git Product logo

name-that-color-intellij-plugin's Introduction

Name That Color - Android Studio Plugin

Introduction

When I get a new color to set in my Android app, I never know how to call it.

I used the website Name That Color for years, and I wanted to have it integrated inside Android Studio, so I ported its JS library to Kotlin and built this IntelliJ plugin around it.

Besides its long list of colors, users requested to add the material colors names, so we can now name our colors as material colors as well.

This plugin lets you insert a name for a color you copy-paste or type in an android resource file.

Usage

Two options are available: Clipboard and Quick Fix.

Clipboard

When you copy your color to add it in your app, you can use CONTROL+SPACE instead of pasting it to insert directly the right <color> tag.

after entering CONTROL+SPACE

Quick Fix

You can insert "aaa" and an error warning in the form of a Quick Fix will show up so you can replace "aaa" with its own <color name="silver_chalice">#aaa</color> tag by using ALT+ENTER.

after entering ALT+ENTER

Color Input

The Plugin accepts all formats of colors allowed in Android (lowercase or uppercase), and you don't need to prefix your color with "#":

  • Color
    • abc -> #abc
    • #abc -> #abc
    • aBc -> #aBc
    • ab12dc -> #ab12dc
    • #ab12dc -> #ab12dc
  • Alpha + Color
    • 6abc -> #6abc
    • #6abc -> #6abc
    • 60ab12dc -> #60ab12dc
    • #60ab12dc -> #60ab12dc

Names

Name that color

If you chose to use "Name that color", this list of colors is used. If the exact color is not found, the algorithm will find the closest match, if possible.

Examples
  • Color
    • abc -> <color name="casper">#abc</color>
    • ab12dc -> <color name="electric_violet">#ab12dc</color>
  • Alpha + Color
    • 6abc -> <color name="casper_alpha_40">#6abc</color>
    • 60ab12dc -> <color name="electric_violet_alpha_38">#60ab12dc</color>
  • Alpha(%) + Color
    • 40%abc -> <color name="casper_alpha_40">#66AABBCC</color>
    • 38%ab12dc -> <color name="electric_violet_alpha_38">#61AB12DC</color>

Name that material color

If you chose to use "Name that material color", this list of material colors is used. If the exact color is not found, the algorithm will find the closest match, if possible.

Examples
  • Color
    • abc -> <color name="blue_grey_200">#abc</color>
    • ab12dc -> <color name="purple_a700">#ab12dc</color>
  • Alpha + Color
    • 6abc -> <color name="blue_grey_200_alpha_40">#6abc</color>
    • 60ab12dc -> <color name="purple_a700_alpha_38">#60ab12dc</color>
  • Alpha(%) + Color
    • 40%abc -> <color name="blue_grey_200_alpha_40">#66AABBCC</color>
    • 38%ab12dc -> <color name="purple_a700_alpha_38">#61AB12DC</color>

Install

In Android Studio, open Settings > Plugins > Browse Plugins and type "name that color".

Thanks

I'd like to thank aednlaxer for submitting bugs and ideas!

License

This plugin is released under the: Creative Commons License: Attribution 2.5 http://creativecommons.org/licenses/by/2.5/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.