Android Color Parse toARGB(String colorString)

Here you can find the source of toARGB(String colorString)

Description

to ARGB

License

Open Source License

Parameter

Parameter Description
colorString #RRGGBB or #AARRGGBB or... read Color#parseColor(String)

Declaration

public static int toARGB(String colorString) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*  w  ww . jav a 2 s  .co m*/
     * @param alpha
     *            [0..255]
     * @param red
     *            [0..255]
     * @param green
     *            [0..255]
     * @param blue
     *            [0..255]
     * @return the calculated argb value
     */
    public static int toARGB(int alpha, int red, int green, int blue) {
        return android.graphics.Color.argb(alpha, red, green, blue);
    }

    /**
     * @param colorString
     *            #RRGGBB or #AARRGGBB or... read
     *            {@link Color#parseColor(String)}
     * @return
     */
    public static int toARGB(String colorString) {
        return android.graphics.Color.parseColor(colorString);
    }
}

Related

  1. parseColor(String inColor)
  2. parseColor(String colorName)
  3. parseHexColor(String colorStr)
  4. toARGB(int alpha, int red, int green, int blue)