public static Color randomGrayColor(int min, int max) { int r = randInt(min, max); return new Color(r, r, r); }
public static Color grayColor() { int n = randInt(255); return new Color(n, n, n); }
/** * return a random string with 16 to 100 (inclusive) chars. */ public static String longRandom() { return random(16 + N.randInt(85)); }
/** * return a random string with 6 to 15 (inclusive) chars. */ public static String mediumRandom() { return random(6 + N.randInt(10)); }
/** * return a random string with 2 to 5 (inclusive) chars. */ public static String shortRandom() { return random(2 + N.randInt(4)); }
@Override public String get() { return S.random(2 + N.randInt(20)); } }
/** * return a random string with 16 to 100 (inclusive) chars. */ public static String longRandom() { return random(16 + N.randInt(85)); }
/** * return a URL safe random string with 16 to 100 (inclusive) chars. */ public static String longUrlSafeRandom() { return urlSafeRandom(16 + N.randInt(85)); }
@Override public String get() { return S.random(2 + N.randInt(20)); } }
/** * return a random string with 6 to 15 (inclusive) chars. */ public static String mediumRandom() { return random(6 + N.randInt(10)); }
/** * return a URL safe random string with 2 to 5 (inclusive) chars. */ public static String shortUrlSafeRandom() { return urlSafeRandom(2 + N.randInt(4)); }
/** * return a URL safe random string with 6 to 15 (inclusive) chars. */ public static String mediumUrlSafeRandom() { return urlSafeRandom(6 + N.randInt(10)); }
/** * return a URL safe random string with 16 to 100 (inclusive) chars. */ public static String longUrlSafeRandom() { return urlSafeRandom(16 + N.randInt(85)); }
/** * return a random string with 2 to 5 (inclusive) chars. */ public static String shortRandom() { return random(2 + N.randInt(4)); }
/** * return a URL safe random string with 6 to 15 (inclusive) chars. */ public static String mediumUrlSafeRandom() { return urlSafeRandom(6 + N.randInt(10)); }
@Override public BufferedImage render(String text) { List<? extends Img.Processor> processors = $.random(true, false) ? optionalA : optionalB; return Img.source(backgroundGenerator) .text(text) .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(2 + randInt(5)) .setMaxLineWidth(3) .pipeline(processors) .get(); }
@Override public BufferedImage render(String text) { List<? extends Img.Processor> processors = $.random(true, false) ? optionalA : optionalB; return Img.source(backgroundGenerator) .text(text) .color(Img.Random.darkColor()) .makeNoise() .setMaxLines(2 + randInt(5)) .setMaxLineWidth(3) .pipeline(processors) .get(); }