Browse Source

fix color bug

Looly 5 years ago
parent
commit
1c8158dc48
2 changed files with 3 additions and 2 deletions
  1. 1 0
      CHANGELOG.md
  2. 2 2
      hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java

+ 1 - 0
CHANGELOG.md

@@ -37,6 +37,7 @@
 * 【core   】     修复Linux下使用Windows路径分隔符导致的解压错误(issue#I1MW0E@Gitee)
 * 【core   】     修复Linux下使用Windows路径分隔符导致的解压错误(issue#I1MW0E@Gitee)
 * 【core   】     修复Word07Writer写出map问题(issue#I1W49R@Gitee)
 * 【core   】     修复Word07Writer写出map问题(issue#I1W49R@Gitee)
 * 【script 】     修复函数库脚本执行问题
 * 【script 】     修复函数库脚本执行问题
+* 【core   】     修复RGB随机颜色的上限值不对且API重复(pr#1136@Gihub)
 
 
 -------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------
 
 

+ 2 - 2
hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java

@@ -524,9 +524,9 @@ public class RandomUtil {
 	 * @since 4.1.5
 	 * @since 4.1.5
 	 * @deprecated 使用{@link ImagUtil#randomColor()}
 	 * @deprecated 使用{@link ImagUtil#randomColor()}
 	 */
 	 */
-	public static Color randomColor() {
+		public static Color randomColor() {
 		final Random random = getRandom();
 		final Random random = getRandom();
-		return new Color(random.nextInt(256), random.nextInt(2565), random.nextInt(256));
+		return new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256));
 	}
 	}
 
 
 	/**
 	/**