List of utility methods to do Random Color
Color | getRandColor(int fc, int bc) get Rand Color int f = fc; int b = bc; Random random = new Random(); if (f > 255) { f = 255; if (b > 255) { b = 255; ... |
Color | getRandColor(int fc, int bc) get Rand Color int _fc = 255; if (fc < 255) { _fc = fc; int _bc = 255; if (bc < 255) { _bc = bc; int r = _fc + random.nextInt(_bc - _fc); int g = _fc + random.nextInt(_bc - _fc); int b = _fc + random.nextInt(_bc - _fc); return new Color(r, g, b); |
Color | getRandColor(int fc, int bc) get Rand Color Random random = new Random(); int r = fc + random.nextInt(bc - fc); int g = fc + random.nextInt(bc - fc); int b = fc + random.nextInt(bc - fc); return new Color(r, g, b); |
Color | getRandom() get Random int r = randomInt(256), g = randomInt(256), b = randomInt(256); return new Color(r, g, b); |
String | getRandomColor() get Random Color Integer red = rand.nextInt(255); Integer blie = rand.nextInt(255); Integer yellow = rand.nextInt(255); String color = "#" + red.toHexString(red) + blie.toHexString(blie) + yellow.toHexString(yellow); return color; |
Color | getRandomColor() get Random Color return new Color(RND.nextInt()); |
Color | getRandomColor() get Random Color Random rand = new Random(); float r = rand.nextFloat(); float g = rand.nextFloat(); float b = rand.nextFloat(); Color randomColor = new Color(r, g, b); return randomColor; |
String | GetRandomColor() Get Random Color Random rand = new Random(); Integer random = rand.nextInt(17); return dictionary.get(random); |
String | getRandomColor() get Random Color Random ra = new Random(); int r, g, b; r = ra.nextInt(255); g = ra.nextInt(255); b = ra.nextInt(255); String hex = String.format("#%02x%02x%02x", r, g, b); return hex; |
byte | getRandomColor() get Random Color int color = 1 + RANDOM.nextInt(11); color = color > 6 ? color + 2 : color; color = color > 11 ? color + 1 : color; return (byte) color; |