altium-toolkit 1.1.39 → 1.1.41
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/package.json +1 -1
- package/src/core/altium/AltiumLayoutParser.mjs +9 -4
- package/src/core/altium/PcbLayerStackReadModelBuilder.mjs +1 -0
- package/src/core/altium/SchematicPinParser.mjs +82 -13
- package/src/styles/altium-renderers.css +67 -1
- package/src/ui/PcbInteractionLayerModel.mjs +6 -2
- package/src/ui/PcbPadMaskApertureRenderer.mjs +288 -0
- package/src/ui/PcbSvgRenderer.mjs +674 -38
- package/src/ui/SchematicColorResolver.mjs +30 -0
|
@@ -49,6 +49,12 @@ export class SchematicColorResolver {
|
|
|
49
49
|
return normalized
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
if (SchematicColorResolver.#isDefaultInkSourceColor(normalized)) {
|
|
53
|
+
return SchematicColorResolver.#toVariable(
|
|
54
|
+
'--schematic-default-ink-color'
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
52
58
|
const token = COLOR_TOKEN_BY_VALUE.get(normalized)
|
|
53
59
|
|
|
54
60
|
if (token) {
|
|
@@ -316,6 +322,30 @@ export class SchematicColorResolver {
|
|
|
316
322
|
return Math.max(rgb.r, rgb.g, rgb.b) <= 32
|
|
317
323
|
}
|
|
318
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Returns true for dark saturated blue source colors that represent
|
|
327
|
+
* Altium's default schematic ink family rather than custom artwork color.
|
|
328
|
+
* @param {string} color Normalized color.
|
|
329
|
+
* @returns {boolean}
|
|
330
|
+
*/
|
|
331
|
+
static #isDefaultInkSourceColor(color) {
|
|
332
|
+
const rgb = SchematicColorResolver.#parseHexColor(color)
|
|
333
|
+
if (!rgb) {
|
|
334
|
+
return false
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const hsl = SchematicColorResolver.#rgbToHsl(rgb)
|
|
338
|
+
const hueDegrees = hsl.h * 360
|
|
339
|
+
|
|
340
|
+
return (
|
|
341
|
+
hueDegrees >= 220 &&
|
|
342
|
+
hueDegrees <= 270 &&
|
|
343
|
+
hsl.s >= 45 &&
|
|
344
|
+
hsl.l >= 12 &&
|
|
345
|
+
hsl.l <= 38
|
|
346
|
+
)
|
|
347
|
+
}
|
|
348
|
+
|
|
319
349
|
/**
|
|
320
350
|
* Converts RGB channels to HSL.
|
|
321
351
|
* @param {{ r: number, g: number, b: number }} color
|