generate random dark colors programatically in android
Random rnd = new Random();
paint.setARGB(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
generate random dark colors programatically in android
Random rnd = new Random();
paint.setARGB(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
generate random light color android
final Random mRandom = new Random(System.currentTimeMillis());
public int generateRandomColor() {
// This is the base color which will be mixed with the generated one
final int baseColor = Color.WHITE;
final int baseRed = Color.red(baseColor);
final int baseGreen = Color.green(baseColor);
final int baseBlue = Color.blue(baseColor);
final int red = (baseRed + mRandom.nextInt(256)) / 2;
final int green = (baseGreen + mRandom.nextInt(256)) / 2;
final int blue = (baseBlue + mRandom.nextInt(256)) / 2;
return Color.rgb(red, green, blue);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us