alpha-color

Description

This is an android studio plugin that allows you to creates new color in hex format based on a percentage (0-100) and a
base color you specify i.e.

Example 1:

<color name="black">#000000</color>

when you supply 87 as the percentage, results in

<color name="black_87">#DE000000</color>

Example 2:

val textView = TextView(context)
textView.setTextColor(Color.parseColor("#000000"))
textView.setTextColor(0XFF000000)

when you supply 50 as the percentage, results in

val textView = TextView(context)
textView.setTextColor(Color.parseColor("#80000000"))
textView.setTextColor(0X80000000)

Example 3:

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="alpha-color"
        android:textColor="#000000"/>

when you supply 10 as the percentage, results in

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="alpha-color"
        android:textColor="#1A000000"/>

Usage

  1. Hop over to your “color code” and press alt + cmd (on windows Enter).
  2. Click on Generate alpha variant.
  3. Key in the percentage and click OK

Installation

  • Manually:

    Download the latest release and install it manually
    using
    Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...


GitHub

View Github