ohzi-core 9.1.0 → 9.2.0
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
CHANGED
|
@@ -3,6 +3,20 @@ class StringUtilities
|
|
|
3
3
|
constructor()
|
|
4
4
|
{}
|
|
5
5
|
|
|
6
|
+
static get_random_color()
|
|
7
|
+
{
|
|
8
|
+
const hexValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'];
|
|
9
|
+
let hex = '#';
|
|
10
|
+
|
|
11
|
+
for (let i = 0; i < 6; i++)
|
|
12
|
+
{
|
|
13
|
+
const index = Math.floor(Math.random() * hexValues.length);
|
|
14
|
+
hex += hexValues[index];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return hex;
|
|
18
|
+
}
|
|
19
|
+
|
|
6
20
|
static capitalize(string)
|
|
7
21
|
{
|
|
8
22
|
const words = string.split(' ');
|