wenay-common 1.0.176 → 1.0.178
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/lib/Common/Color.d.ts +1 -0
- package/lib/Common/Color.js +6 -1
- package/lib/client.d.ts +1 -0
- package/lib/client.js +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/toError/myThrow.d.ts +3 -0
- package/lib/toError/myThrow.js +11 -0
- package/package.json +1 -1
package/lib/Common/Color.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare function colorGenerator2(data?: {
|
|
|
22
22
|
min?: number;
|
|
23
23
|
max?: number;
|
|
24
24
|
}): Generator<[number, number, number]>;
|
|
25
|
+
export declare function colorGeneratorByCount2(value?: number, count?: number, index?: number): [number, number, number];
|
|
25
26
|
export declare function colorGeneratorByCount(value?: number, count?: number, index?: number): ColorString;
|
|
26
27
|
export declare function colorStringToRGBA(str: ColorString): [number, number, number, number];
|
|
27
28
|
export declare function colorStringToRGBA(str: string): [number, number, number, number] | undefined;
|
package/lib/Common/Color.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.rgb = rgb;
|
|
4
4
|
exports.colorGenerator = colorGenerator;
|
|
5
5
|
exports.colorGenerator2 = colorGenerator2;
|
|
6
|
+
exports.colorGeneratorByCount2 = colorGeneratorByCount2;
|
|
6
7
|
exports.colorGeneratorByCount = colorGeneratorByCount;
|
|
7
8
|
exports.colorStringToRGBA = colorStringToRGBA;
|
|
8
9
|
exports.toColorString = toColorString;
|
|
@@ -66,13 +67,17 @@ function* colorGenerator2(data) {
|
|
|
66
67
|
}
|
|
67
68
|
yield [-1, -1, -1];
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function colorGeneratorByCount2(value = 180, count = 100, index = 1) {
|
|
70
71
|
const step = Math.floor(value * 6 * index / count);
|
|
71
72
|
const p = Math.floor(step / value);
|
|
72
73
|
const z = Math.floor(step % value);
|
|
73
74
|
const r = (p == 0 || p == 5) ? value : (p == 1) ? value - z : (p == 4) ? z : 0;
|
|
74
75
|
const g = (p == 1 || p == 2) ? value : (p == 3) ? value - z : (p == 0) ? z : 0;
|
|
75
76
|
const b = (p == 3 || p == 4) ? value : (p == 5) ? value - z : (p == 2) ? z : 0;
|
|
77
|
+
return [r, g, b];
|
|
78
|
+
}
|
|
79
|
+
function colorGeneratorByCount(value = 180, count = 100, index = 1) {
|
|
80
|
+
const [r, g, b] = colorGeneratorByCount2(value, count, index);
|
|
76
81
|
return `rgb(${r},${g},${b})`;
|
|
77
82
|
}
|
|
78
83
|
function colorStringToRGBA(str) {
|
package/lib/client.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./Common/common";
|
|
|
3
3
|
export * from "./Common/Color";
|
|
4
4
|
export * from "./Common/ListNodeAnd";
|
|
5
5
|
export * from "./Common/Math";
|
|
6
|
+
export * from "./toError/myThrow";
|
|
6
7
|
export * from "./Exchange/ConnectData/Binance";
|
|
7
8
|
export * as BaseTypes from "./Common/BaseTypes";
|
|
8
9
|
export * as Common from "./Common/common";
|
package/lib/client.js
CHANGED
|
@@ -33,6 +33,7 @@ __exportStar(require("./Common/common"), exports);
|
|
|
33
33
|
__exportStar(require("./Common/Color"), exports);
|
|
34
34
|
__exportStar(require("./Common/ListNodeAnd"), exports);
|
|
35
35
|
__exportStar(require("./Common/Math"), exports);
|
|
36
|
+
__exportStar(require("./toError/myThrow"), exports);
|
|
36
37
|
__exportStar(require("./Exchange/ConnectData/Binance"), exports);
|
|
37
38
|
exports.BaseTypes = __importStar(require("./Common/BaseTypes"));
|
|
38
39
|
exports.Common = __importStar(require("./Common/common"));
|
package/lib/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./Common/Math";
|
|
|
13
13
|
export * from "./Common/objectPath";
|
|
14
14
|
export * from "./Common/waitRun";
|
|
15
15
|
export * from "./Common/Listen";
|
|
16
|
+
export * from "./toError/myThrow";
|
|
16
17
|
export * from "./Exchange/Bars";
|
|
17
18
|
export * from "./Exchange/LoadBase";
|
|
18
19
|
export * from "./Exchange/ConnectData/Binance";
|
package/lib/index.js
CHANGED
|
@@ -43,6 +43,7 @@ __exportStar(require("./Common/Math"), exports);
|
|
|
43
43
|
__exportStar(require("./Common/objectPath"), exports);
|
|
44
44
|
__exportStar(require("./Common/waitRun"), exports);
|
|
45
45
|
__exportStar(require("./Common/Listen"), exports);
|
|
46
|
+
__exportStar(require("./toError/myThrow"), exports);
|
|
46
47
|
__exportStar(require("./Exchange/Bars"), exports);
|
|
47
48
|
__exportStar(require("./Exchange/LoadBase"), exports);
|
|
48
49
|
__exportStar(require("./Exchange/ConnectData/Binance"), exports);
|