mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
随机颜色范围会导致255取不到
This commit is contained in:
parent
322c95fde2
commit
699e14acac
@ -62,6 +62,12 @@ public class ImgUtil {
|
|||||||
public static final String IMAGE_TYPE_PNG = "png";// 可移植网络图形
|
public static final String IMAGE_TYPE_PNG = "png";// 可移植网络图形
|
||||||
public static final String IMAGE_TYPE_PSD = "psd";// Photoshop的专用格式Photoshop
|
public static final String IMAGE_TYPE_PSD = "psd";// Photoshop的专用格式Photoshop
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RGB颜色范围上限
|
||||||
|
*/
|
||||||
|
private static final int RGB_COLOR_BOUND = 256;
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------------------------------------------- scale
|
// ---------------------------------------------------------------------------------------------------------------------- scale
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1952,7 +1958,7 @@ public class ImgUtil {
|
|||||||
if (null == random) {
|
if (null == random) {
|
||||||
random = RandomUtil.getRandom();
|
random = RandomUtil.getRandom();
|
||||||
}
|
}
|
||||||
return new Color(random.nextInt(255), random.nextInt(255), random.nextInt(255));
|
return new Color(random.nextInt(RGB_COLOR_BOUND), random.nextInt(RGB_COLOR_BOUND), random.nextInt(RGB_COLOR_BOUND));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user