Android Color Blend createGrayGradient3()

Here you can find the source of createGrayGradient3()

Description

create Gray Gradient

License

Open Source License

Declaration

public static int[] createGrayGradient3() 

Method Source Code

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

public class Main {
    public static int[] createGrayGradient3() {
        int[] c = new int[3];
        int f = -40;
        c[0] = toARGB(0, 160 + f, 160 + f, 160 + f);
        c[1] = toARGB(255, 185 + f, 185 + f, 185 + f);
        c[2] = toARGB(0, 160 + f, 160 + f, 160 + f);
        return c;
    }//from   www. j  a  va  2s.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. screenBlendTwoColors(int c1, int c2)
  2. createGrayGradient1()
  3. createGrayGradient2()
  4. createGreenGradient()
  5. createRGBColorFilter(int red, int green, int blue)
  6. createRGBColorFilter(int red, int green, int blue, float alpha)
  7. createColorChangeFilter( int newColor)