@lntvow/utils 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -2
- package/src/getRandom.ts +0 -27
- package/src/index.ts +0 -1
package/package.json
CHANGED
package/src/getRandom.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 获取随机颜色
|
|
3
|
-
* @return {String} 颜色
|
|
4
|
-
*
|
|
5
|
-
* @example getRandomColor() => '#f36a38'
|
|
6
|
-
* */
|
|
7
|
-
|
|
8
|
-
export function getRandomColor() {
|
|
9
|
-
return `#${Math.random().toString(16).slice(2, 8).padEnd(6, '0')}`
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description 获取随机颜色
|
|
14
|
-
* @return {String} 颜色
|
|
15
|
-
*
|
|
16
|
-
* @example getRandomColor(10) => '#f36a38'
|
|
17
|
-
* */
|
|
18
|
-
|
|
19
|
-
export function getRandom(number: number) {
|
|
20
|
-
if (number > 11) {
|
|
21
|
-
} else {
|
|
22
|
-
return Math.random()
|
|
23
|
-
.toString()
|
|
24
|
-
.slice(2, number + 2)
|
|
25
|
-
.padEnd(6, '0')
|
|
26
|
-
}
|
|
27
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './getRandom'
|