nekos 1.2.0 → 1.2.1
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/index.cjs +2347 -33
- package/index.js +3 -11
- package/package.json +3 -1
package/index.js
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
|
+
import { hex } from "@randplus/color";
|
|
4
5
|
import gradient from "gradient-string";
|
|
5
6
|
|
|
6
|
-
/**
|
|
7
|
-
* Generates a random HEX color code (e.g., #1a2b3c).
|
|
8
|
-
* @returns {string} A random color code.
|
|
9
|
-
*/
|
|
10
|
-
function getRandomHexColor() {
|
|
11
|
-
const randomColor = Math.floor(Math.random() * 16777216).toString(16);
|
|
12
|
-
return `#${randomColor.padStart(6, "0")}`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
16
8
|
const __dirname = path.dirname(__filename);
|
|
17
9
|
const aaDir = path.join(__dirname, "aa");
|
|
@@ -66,14 +58,14 @@ function nekos(options = {}) {
|
|
|
66
58
|
if (upperCaseColor === "RAINBOW") {
|
|
67
59
|
processedColors = rainbowColors;
|
|
68
60
|
} else if (upperCaseColor === "RANDOM") {
|
|
69
|
-
processedColors = [
|
|
61
|
+
processedColors = [hex("#")];
|
|
70
62
|
} else {
|
|
71
63
|
processedColors = [colors];
|
|
72
64
|
}
|
|
73
65
|
} else if (Array.isArray(colors)) {
|
|
74
66
|
processedColors = colors.map((color) =>
|
|
75
67
|
typeof color === "string" && color.toUpperCase() === "RANDOM"
|
|
76
|
-
?
|
|
68
|
+
? hex("#")
|
|
77
69
|
: color
|
|
78
70
|
);
|
|
79
71
|
} else {
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nekos",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Let's have cute cats mess around in the log!",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"exports": {
|
|
7
8
|
"import": "./index.js",
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
},
|
|
33
34
|
"homepage": "https://github.com/otoneko1102/nekos#readme",
|
|
34
35
|
"dependencies": {
|
|
36
|
+
"@randplus/color": "^2.1.4",
|
|
35
37
|
"gradient-string": "^3.0.0"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|