List of usage examples for android.graphics Color rgb
@ColorInt public static int rgb(float red, float green, float blue)
From source file:Main.java
/** * Returns the base color overlaid with another overlay color with a specified alpha. *//*from www . j a v a 2 s . c o m*/ public static int getColorWithOverlay(int baseColor, int overlayColor, float overlayAlpha) { return Color.rgb( (int) (overlayAlpha * Color.red(baseColor) + (1f - overlayAlpha) * Color.red(overlayColor)), (int) (overlayAlpha * Color.green(baseColor) + (1f - overlayAlpha) * Color.green(overlayColor)), (int) (overlayAlpha * Color.blue(baseColor) + (1f - overlayAlpha) * Color.blue(overlayColor))); }
From source file:Main.java
public static int getColorByRGB(int[] intRgb) { if (intRgb.length != 3) { return 0xffffff; }/*from w w w .jav a 2 s .com*/ System.out.println(intRgb[0] + "|" + intRgb[1] + "|" + intRgb[2] + "|"); return Color.rgb(intRgb[0], intRgb[1], intRgb[2]); }
From source file:Main.java
public static int randomColr() { Random random = new Random(); int r = random.nextInt(180); int g = random.nextInt(180); int b = random.nextInt(180); return Color.rgb(r, g, b); }
From source file:Main.java
public static int colorById(final int id) { int r = (150 - id * 25) % 255; int g = (200 + id * 75) % 255; int b = (125 + id * 125) % 255; return Color.rgb(r, g, b); }
From source file:Main.java
public static Bitmap convert(float[] normals, int width, int height) { int[] pixels = new int[width * height]; for (int i = 0; i < width * height; i++) { pixels[i] = Color.rgb((int) normals[4 * i + 0], (int) normals[4 * i + 1], (int) normals[4 * i + 2]); }//from w w w. j a v a 2 s. co m return Bitmap.createBitmap(pixels, width, height, Bitmap.Config.ARGB_8888); }
From source file:Main.java
public static int randomColor() { Random __rdn = new Random(); int __red = __rdn.nextInt(255); int __green = __rdn.nextInt(255); int __blue = __rdn.nextInt(255); return Color.rgb(__red, __green, __blue); }
From source file:Main.java
/** * Returns a random color./* w w w . j a v a 2 s . c om*/ * @return */ public static int getRandomColor() { return Color.rgb(randomGenerator.nextInt(255), randomGenerator.nextInt(255), randomGenerator.nextInt(255)); }
From source file:Main.java
public static int rgbToColor(int R, int G, int B) { return Color.rgb(R, G, B); }
From source file:Main.java
public static int randomColor() { Random random = new Random(); int red = random.nextInt(150) + 50; int green = random.nextInt(150) + 50; int blue = random.nextInt(150) + 50; return Color.rgb(red, green, blue); }
From source file:Main.java
public static int getRandomColor() { Random random = new Random(); int red = random.nextInt(200) + 30; int gre = random.nextInt(200) + 30; int blu = random.nextInt(200) + 30; return Color.rgb(red, gre, blu); }