@seatlayer/core 0.28.0 → 0.28.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/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1098,6 +1098,15 @@ function stateAwareBookableLabelInk(fill, preferred) {
|
|
|
1098
1098
|
if (darkContrast === 0 && lightContrast === 0) return preferred;
|
|
1099
1099
|
return darkContrast >= lightContrast ? DARK_BOOKABLE_LABEL_INK : LIGHT_BOOKABLE_LABEL_INK;
|
|
1100
1100
|
}
|
|
1101
|
+
var GLYPH_CONTRAST = 3;
|
|
1102
|
+
function accessGlyphInk(fill) {
|
|
1103
|
+
const white = renderedTextContrast("#ffffff", fill);
|
|
1104
|
+
if (white != null && white >= GLYPH_CONTRAST) return "#ffffff";
|
|
1105
|
+
const darkContrast = renderedTextContrast(DARK_BOOKABLE_LABEL_INK, fill) ?? 0;
|
|
1106
|
+
const lightContrast = renderedTextContrast(LIGHT_BOOKABLE_LABEL_INK, fill) ?? 0;
|
|
1107
|
+
if (darkContrast === 0 && lightContrast === 0) return "#ffffff";
|
|
1108
|
+
return darkContrast >= lightContrast ? DARK_BOOKABLE_LABEL_INK : LIGHT_BOOKABLE_LABEL_INK;
|
|
1109
|
+
}
|
|
1101
1110
|
|
|
1102
1111
|
// src/core/renderedQuality.ts
|
|
1103
1112
|
var RENDERED_QUALITY_REPORT_VERSION = 3;
|
|
@@ -4430,7 +4439,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
4430
4439
|
offsetY: ACCESS_GLYPH_VIEWBOX / 2,
|
|
4431
4440
|
scaleX: k,
|
|
4432
4441
|
scaleY: k,
|
|
4433
|
-
fill:
|
|
4442
|
+
fill: accessGlyphInk(seatFill),
|
|
4434
4443
|
listening: false,
|
|
4435
4444
|
visible: false,
|
|
4436
4445
|
perfectDrawEnabled: false,
|
|
@@ -4593,7 +4602,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
4593
4602
|
const accessGlyph = this.accessGlyphById.get(id);
|
|
4594
4603
|
if (accessGlyph) {
|
|
4595
4604
|
const fill = c.fill();
|
|
4596
|
-
accessGlyph.fill(
|
|
4605
|
+
accessGlyph.fill(accessGlyphInk(typeof fill === "string" ? fill : ""));
|
|
4597
4606
|
accessGlyph.opacity(c.opacity());
|
|
4598
4607
|
accessGlyph.visible(this.accessGlyphShouldShow(id));
|
|
4599
4608
|
}
|