@arcblock/nft-display 2.10.0 → 2.10.2
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/color.js +6 -6
- package/package.json +13 -13
package/lib/color.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MOTIF_COLORS = exports.DEFAULT_COLORS = void 0;
|
|
4
|
+
exports.rgbToHsl = rgbToHsl;
|
|
5
|
+
exports.hslToRgb = hslToRgb;
|
|
6
|
+
exports.getNftBGColor = getNftBGColor;
|
|
7
|
+
exports.getPassportColorFromDid = getPassportColorFromDid;
|
|
8
|
+
exports.getNftBGColorFromDid = getNftBGColorFromDid;
|
|
4
9
|
const util_1 = require("@ocap/util");
|
|
5
10
|
const mcrypto_1 = require("@ocap/mcrypto");
|
|
6
11
|
exports.DEFAULT_COLORS = {
|
|
@@ -94,7 +99,6 @@ function rgbToHsl(rgbString) {
|
|
|
94
99
|
}
|
|
95
100
|
return [h, s, l];
|
|
96
101
|
}
|
|
97
|
-
exports.rgbToHsl = rgbToHsl;
|
|
98
102
|
/**
|
|
99
103
|
* Convert HSL color value to RGB.
|
|
100
104
|
* @param {number} h - The hue.
|
|
@@ -136,7 +140,6 @@ function hslToRgb(h, s, l) {
|
|
|
136
140
|
.map((e) => e.toString(16).padStart(2, '0'))
|
|
137
141
|
.join('')}`;
|
|
138
142
|
}
|
|
139
|
-
exports.hslToRgb = hslToRgb;
|
|
140
143
|
/**
|
|
141
144
|
* Convert a single color to usable NFT gradient background colors.
|
|
142
145
|
* @param {string} rgbString - The background color in RGB format.
|
|
@@ -176,7 +179,6 @@ function getNftBGColor(rgbString) {
|
|
|
176
179
|
}
|
|
177
180
|
return exports.DEFAULT_COLORS['app-passport'];
|
|
178
181
|
}
|
|
179
|
-
exports.getNftBGColor = getNftBGColor;
|
|
180
182
|
/**
|
|
181
183
|
* Get passport color from DID.
|
|
182
184
|
* @param {string} did - The DID.
|
|
@@ -185,7 +187,6 @@ exports.getNftBGColor = getNftBGColor;
|
|
|
185
187
|
function getPassportColorFromDid(did) {
|
|
186
188
|
return `#${(0, util_1.toHex)(mcrypto_1.Hasher.SHA3.hash224(did)).slice(-6)}`;
|
|
187
189
|
}
|
|
188
|
-
exports.getPassportColorFromDid = getPassportColorFromDid;
|
|
189
190
|
/**
|
|
190
191
|
* Get NFT background color from DID.
|
|
191
192
|
* @param {string} did - The DID.
|
|
@@ -194,4 +195,3 @@ exports.getPassportColorFromDid = getPassportColorFromDid;
|
|
|
194
195
|
function getNftBGColorFromDid(did) {
|
|
195
196
|
return getNftBGColor(getPassportColorFromDid(did));
|
|
196
197
|
}
|
|
197
|
-
exports.getNftBGColorFromDid = getNftBGColorFromDid;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/nft-display",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"description": "arcblock's nft display generic component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nft"
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@arcblock/did-motif": "^1.1.13",
|
|
28
|
-
"@ocap/mcrypto": "^1.18.
|
|
29
|
-
"@ocap/util": "^1.18.
|
|
28
|
+
"@ocap/mcrypto": "^1.18.124",
|
|
29
|
+
"@ocap/util": "^1.18.124"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@arcblock/eslint-config-ts": "^0.2
|
|
33
|
-
"@types/jest": "^29.
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
36
|
-
"@typescript-eslint/parser": "^
|
|
37
|
-
"express": "^4.
|
|
32
|
+
"@arcblock/eslint-config-ts": "^0.3.2",
|
|
33
|
+
"@types/jest": "^29.5.12",
|
|
34
|
+
"@types/node": "^20.14.9",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
36
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
37
|
+
"express": "^4.19.2",
|
|
38
38
|
"jest": "28",
|
|
39
|
-
"nodemon": "^
|
|
39
|
+
"nodemon": "^3.1.4",
|
|
40
40
|
"ts-jest": "28",
|
|
41
|
-
"ts-node": "^10.9.
|
|
42
|
-
"typescript": "^5.
|
|
41
|
+
"ts-node": "^10.9.2",
|
|
42
|
+
"typescript": "^5.5.2"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "01c29cd905a2baf029d7be25d41c79a261ebd959"
|
|
45
45
|
}
|