@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.cjs
CHANGED
|
@@ -1377,6 +1377,15 @@ function stateAwareBookableLabelInk(fill, preferred) {
|
|
|
1377
1377
|
if (darkContrast === 0 && lightContrast === 0) return preferred;
|
|
1378
1378
|
return darkContrast >= lightContrast ? DARK_BOOKABLE_LABEL_INK : LIGHT_BOOKABLE_LABEL_INK;
|
|
1379
1379
|
}
|
|
1380
|
+
var GLYPH_CONTRAST = 3;
|
|
1381
|
+
function accessGlyphInk(fill) {
|
|
1382
|
+
const white = renderedTextContrast("#ffffff", fill);
|
|
1383
|
+
if (white != null && white >= GLYPH_CONTRAST) return "#ffffff";
|
|
1384
|
+
const darkContrast = renderedTextContrast(DARK_BOOKABLE_LABEL_INK, fill) ?? 0;
|
|
1385
|
+
const lightContrast = renderedTextContrast(LIGHT_BOOKABLE_LABEL_INK, fill) ?? 0;
|
|
1386
|
+
if (darkContrast === 0 && lightContrast === 0) return "#ffffff";
|
|
1387
|
+
return darkContrast >= lightContrast ? DARK_BOOKABLE_LABEL_INK : LIGHT_BOOKABLE_LABEL_INK;
|
|
1388
|
+
}
|
|
1380
1389
|
|
|
1381
1390
|
// src/core/renderedQuality.ts
|
|
1382
1391
|
var RENDERED_QUALITY_REPORT_VERSION = 3;
|
|
@@ -4709,7 +4718,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
4709
4718
|
offsetY: ACCESS_GLYPH_VIEWBOX / 2,
|
|
4710
4719
|
scaleX: k,
|
|
4711
4720
|
scaleY: k,
|
|
4712
|
-
fill:
|
|
4721
|
+
fill: accessGlyphInk(seatFill),
|
|
4713
4722
|
listening: false,
|
|
4714
4723
|
visible: false,
|
|
4715
4724
|
perfectDrawEnabled: false,
|
|
@@ -4872,7 +4881,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
|
|
|
4872
4881
|
const accessGlyph = this.accessGlyphById.get(id);
|
|
4873
4882
|
if (accessGlyph) {
|
|
4874
4883
|
const fill = c.fill();
|
|
4875
|
-
accessGlyph.fill(
|
|
4884
|
+
accessGlyph.fill(accessGlyphInk(typeof fill === "string" ? fill : ""));
|
|
4876
4885
|
accessGlyph.opacity(c.opacity());
|
|
4877
4886
|
accessGlyph.visible(this.accessGlyphShouldShow(id));
|
|
4878
4887
|
}
|