enefel 1.0.116 → 1.0.119
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/color.js +25 -1
- package/index.js +2 -1
- package/move.js +1 -0
- package/package.json +1 -1
- package/skill.js +4 -0
package/color.js
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
const _ = require("lodash");
|
|
2
2
|
|
|
3
|
+
const colorShade = (col, amt) => {
|
|
4
|
+
col = col.replace(/^#/, "");
|
|
5
|
+
if (col.length === 3)
|
|
6
|
+
col = col[0] + col[0] + col[1] + col[1] + col[2] + col[2];
|
|
7
|
+
|
|
8
|
+
let [r, g, b] = col.match(/.{2}/g);
|
|
9
|
+
[r, g, b] = [
|
|
10
|
+
parseInt(r, 16) + amt,
|
|
11
|
+
parseInt(g, 16) + amt,
|
|
12
|
+
parseInt(b, 16) + amt,
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
r = Math.max(Math.min(255, r), 0).toString(16);
|
|
16
|
+
g = Math.max(Math.min(255, g), 0).toString(16);
|
|
17
|
+
b = Math.max(Math.min(255, b), 0).toString(16);
|
|
18
|
+
|
|
19
|
+
const rr = (r.length < 2 ? "0" : "") + r;
|
|
20
|
+
const gg = (g.length < 2 ? "0" : "") + g;
|
|
21
|
+
const bb = (b.length < 2 ? "0" : "") + b;
|
|
22
|
+
|
|
23
|
+
return `#${rr}${gg}${bb}`;
|
|
24
|
+
};
|
|
25
|
+
|
|
3
26
|
function deltaE(rgbA, rgbB) {
|
|
4
27
|
let labA = rgb2lab(rgbA);
|
|
5
28
|
let labB = rgb2lab(rgbB);
|
|
@@ -97,8 +120,9 @@ const getGameColors = (game) => {
|
|
|
97
120
|
};
|
|
98
121
|
|
|
99
122
|
module.exports = {
|
|
123
|
+
colorShade,
|
|
124
|
+
getGameColors,
|
|
100
125
|
invertColor,
|
|
101
126
|
isColor,
|
|
102
127
|
isColorTooClose,
|
|
103
|
-
getGameColors,
|
|
104
128
|
};
|
package/index.js
CHANGED
|
@@ -160,12 +160,13 @@ const GAME_HISTORY_INFO = {
|
|
|
160
160
|
PASS: "p",
|
|
161
161
|
REJECTION: "r",
|
|
162
162
|
REROLL_COACH: "rc",
|
|
163
|
-
REROLL_RACE_MALUS: "rrm",
|
|
164
163
|
REROLL_METEO: "rm",
|
|
164
|
+
REROLL_RACE_MALUS: "rrm",
|
|
165
165
|
REROLL: "re",
|
|
166
166
|
SCATTER: "sc",
|
|
167
167
|
SKILL: "sk",
|
|
168
168
|
SPY: "spy",
|
|
169
|
+
STANDUP: "st",
|
|
169
170
|
START_FAN: "fan",
|
|
170
171
|
STATUS: "s",
|
|
171
172
|
TAKE_BALL: "t",
|
package/move.js
CHANGED
package/package.json
CHANGED