@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 CHANGED
@@ -12,6 +12,10 @@
12
12
 
13
13
  ### Pending Fixed
14
14
 
15
+ ### v14.23.1 - 2025-02-13
16
+
17
+ - :bug: Fix color issue surfaced by KML Parsing fixes in 14.23
18
+
15
19
  ### v14.23.0 - 2025-02-13
16
20
 
17
21
  - :bug: Fix transparency parsing and writing of KML Alpha values
@@ -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 b = parseInt(rawColor.substring(2, 4), 16);
314
+ const r = parseInt(rawColor.substring(2, 4), 16);
315
315
  const g = parseInt(rawColor.substring(4, 6), 16);
316
- const r = parseInt(rawColor.substring(6, 8), 16);
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 b = parseInt(rawColor.substring(2, 4), 16);
329
+ const r = parseInt(rawColor.substring(2, 4), 16);
330
330
  const g = parseInt(rawColor.substring(4, 6), 16);
331
- const r = parseInt(rawColor.substring(6, 8), 16);
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();
@@ -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}${b}${g}${r}`.toUpperCase();
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/node-cot",
3
3
  "type": "module",
4
- "version": "14.23.0",
4
+ "version": "14.23.1",
5
5
  "description": "Lightweight JavaScript library for parsing and manipulating TAK messages",
6
6
  "author": "Nick Ingalls <nick@ingalls.ca>",
7
7
  "types": "index.ts",
@@ -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 b = parseInt(rawColor.substring(2, 4), 16);
383
+ const r = parseInt(rawColor.substring(2, 4), 16);
384
384
  const g = parseInt(rawColor.substring(4, 6), 16);
385
- const r = parseInt(rawColor.substring(6, 8), 16);
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 b = parseInt(rawColor.substring(2, 4), 16);
402
+ const r = parseInt(rawColor.substring(2, 4), 16);
403
403
  const g = parseInt(rawColor.substring(4, 6), 16);
404
- const r = parseInt(rawColor.substring(6, 8), 16);
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;
@@ -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}${b}${g}${r}`.toUpperCase();
61
+ return `${a}${r}${g}${b}`.toUpperCase();
62
62
  }
63
63
 
64
64
  as_32bit(): number {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/node-cot",
3
3
  "type": "module",
4
- "version": "14.23.0",
4
+ "version": "14.23.1",
5
5
  "description": "Lightweight JavaScript library for parsing and manipulating TAK messages",
6
6
  "author": "Nick Ingalls <nick@ingalls.ca>",
7
7
  "types": "index.ts",