@tak-ps/node-cot 14.23.0 → 14.23.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/CHANGELOG.md +4 -0
- package/dist/lib/parser/to_geojson.js +4 -4
- package/dist/lib/utils/color.js +1 -1
- package/dist/package.json +1 -1
- package/lib/parser/to_geojson.ts +4 -4
- package/lib/utils/color.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -311,9 +311,9 @@ export async function to_geojson(cot) {
|
|
|
311
311
|
if (rawColor.startsWith('#'))
|
|
312
312
|
rawColor = rawColor.substring(1);
|
|
313
313
|
const a = parseInt(rawColor.substring(0, 2), 16);
|
|
314
|
-
const
|
|
314
|
+
const r = parseInt(rawColor.substring(2, 4), 16);
|
|
315
315
|
const g = parseInt(rawColor.substring(4, 6), 16);
|
|
316
|
-
const
|
|
316
|
+
const b = parseInt(rawColor.substring(6, 8), 16);
|
|
317
317
|
const strokeColor = new Color([a, r, g, b]);
|
|
318
318
|
feat.properties.stroke = strokeColor.as_hex();
|
|
319
319
|
feat.properties['stroke-opacity'] = strokeColor.as_opacity() / 255;
|
|
@@ -326,9 +326,9 @@ export async function to_geojson(cot) {
|
|
|
326
326
|
if (rawColor.startsWith('#'))
|
|
327
327
|
rawColor = rawColor.substring(1);
|
|
328
328
|
const a = parseInt(rawColor.substring(0, 2), 16);
|
|
329
|
-
const
|
|
329
|
+
const r = parseInt(rawColor.substring(2, 4), 16);
|
|
330
330
|
const g = parseInt(rawColor.substring(4, 6), 16);
|
|
331
|
-
const
|
|
331
|
+
const b = parseInt(rawColor.substring(6, 8), 16);
|
|
332
332
|
const fillColor = new Color([a, r, g, b]);
|
|
333
333
|
feat.properties['fill-opacity'] = fillColor.as_opacity() / 255;
|
|
334
334
|
feat.properties['fill'] = fillColor.as_hex();
|
package/dist/lib/utils/color.js
CHANGED
|
@@ -52,7 +52,7 @@ export default class Color {
|
|
|
52
52
|
const b = Math.round(this.b).toString(16).padStart(2, '0');
|
|
53
53
|
const g = Math.round(this.g).toString(16).padStart(2, '0');
|
|
54
54
|
const r = Math.round(this.r).toString(16).padStart(2, '0');
|
|
55
|
-
return `${a}${
|
|
55
|
+
return `${a}${r}${g}${b}`.toUpperCase();
|
|
56
56
|
}
|
|
57
57
|
as_32bit() {
|
|
58
58
|
return (this.a << 24) | (this.r << 16) | (this.g << 8) | this.b;
|
package/dist/package.json
CHANGED
package/lib/parser/to_geojson.ts
CHANGED
|
@@ -380,9 +380,9 @@ export async function to_geojson(cot: CoT): Promise<Static<typeof Feature>> {
|
|
|
380
380
|
if (rawColor.startsWith('#')) rawColor = rawColor.substring(1);
|
|
381
381
|
|
|
382
382
|
const a = parseInt(rawColor.substring(0, 2), 16);
|
|
383
|
-
const
|
|
383
|
+
const r = parseInt(rawColor.substring(2, 4), 16);
|
|
384
384
|
const g = parseInt(rawColor.substring(4, 6), 16);
|
|
385
|
-
const
|
|
385
|
+
const b = parseInt(rawColor.substring(6, 8), 16);
|
|
386
386
|
|
|
387
387
|
const strokeColor = new Color([a, r, g, b]);
|
|
388
388
|
feat.properties.stroke = strokeColor.as_hex();
|
|
@@ -399,9 +399,9 @@ export async function to_geojson(cot: CoT): Promise<Static<typeof Feature>> {
|
|
|
399
399
|
if (rawColor.startsWith('#')) rawColor = rawColor.substring(1);
|
|
400
400
|
|
|
401
401
|
const a = parseInt(rawColor.substring(0, 2), 16);
|
|
402
|
-
const
|
|
402
|
+
const r = parseInt(rawColor.substring(2, 4), 16);
|
|
403
403
|
const g = parseInt(rawColor.substring(4, 6), 16);
|
|
404
|
-
const
|
|
404
|
+
const b = parseInt(rawColor.substring(6, 8), 16);
|
|
405
405
|
|
|
406
406
|
const fillColor = new Color([a, r, g, b]);
|
|
407
407
|
feat.properties['fill-opacity'] = fillColor.as_opacity() / 255;
|
package/lib/utils/color.ts
CHANGED
|
@@ -58,7 +58,7 @@ export default class Color {
|
|
|
58
58
|
const g = Math.round(this.g).toString(16).padStart(2, '0');
|
|
59
59
|
const r = Math.round(this.r).toString(16).padStart(2, '0');
|
|
60
60
|
|
|
61
|
-
return `${a}${
|
|
61
|
+
return `${a}${r}${g}${b}`.toUpperCase();
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
as_32bit(): number {
|
package/package.json
CHANGED