From d6cd968e1cbd4dd0f97d85aeacf235893d57a058 Mon Sep 17 00:00:00 2001 From: Jeremy Collins Date: Thu, 25 Jun 2026 17:21:32 -0400 Subject: [PATCH] fix(web): DRGARE depth label unreadable (white-on-white) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dredged-area depth label layer reads the `areas` source-layer, whose `color_token` is the polygon FILL colour. textColor() in day mode resolves the text colour from `color_token`, so the depth value was painted the same light shade as the dredged-area fill — invisible against it. Paint it CHBLK, matching the S-101 catalogue DredgedArea rule (FontColor:CHBLK). The CHBLK token resolves per palette (light ink at dusk/night), so the value stays legible in every scheme. Client-only paint change; no re-bake required. Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/chart-canvas/chart-style.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/chart-canvas/chart-style.mjs b/web/src/chart-canvas/chart-style.mjs index 21c38e8..a67f7fe 100644 --- a/web/src/chart-canvas/chart-style.mjs +++ b/web/src/chart-canvas/chart-style.mjs @@ -170,7 +170,12 @@ function buildLayers(mariner, palette, atlasPpu, osm) { { id: "drgare-labels", type: "symbol", source: "chart", "source-layer": "areas", filter: ["all", ["==", ["get", "class"], "DRGARE"], ["has", "drval1"]], layout: { "text-field": S52.drgareLabelField(mariner), "text-font": FONT, "text-size": 10, "text-allow-overlap": false, "text-optional": true }, - paint: { "text-color": S52.textColor(active, palette), "text-halo-color": S52.textHaloColor(active), "text-halo-width": 1.2 } }, + // FontColor:CHBLK per the S-101 catalogue DredgedArea rule. NOT textColor: + // this layer reads the `areas` source-layer, whose `color_token` is the + // dredged-area FILL colour, so textColor painted the depth value that same + // light shade (white-on-white). The CHBLK token resolves per palette (light + // ink at dusk/night), so it stays legible in every scheme. + paint: { "text-color": S52.token("CHBLK", "#000000", palette), "text-halo-color": S52.textHaloColor(active), "text-halo-width": 1.2 } }, // Light characteristics (LIGHTS06 TX, e.g. "Fl(1)R 3s 4.2m") — their own // layer. It precedes the feature-name layers in the style order, so MapLibre // places light text FIRST: it wins collisions against plain name labels (a name