@celestia-island/hikari 0.55.219 → 0.55.220
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
CHANGED
|
@@ -229,18 +229,13 @@ describe("HkTreemap pure layout input", () => {
|
|
|
229
229
|
).toEqual({ nodes: [], total: 0 });
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
-
it("
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
expect(contrastTextColor("rgb(
|
|
237
|
-
expect(contrastTextColor("#
|
|
238
|
-
expect(contrastTextColor("
|
|
239
|
-
expect(contrastTextColor("not-a-color")).toBe("#fff");
|
|
240
|
-
// Every default palette member must clear WCAG AA with its chosen text.
|
|
241
|
-
for (const color of HK_TREEMAP_DEFAULT_COLORS) {
|
|
242
|
-
expect(["#fff", "#0b1220"]).toContain(contrastTextColor(color));
|
|
243
|
-
}
|
|
232
|
+
it("cell labels follow the theme icon/text token, not a per-block flip", () => {
|
|
233
|
+
// User direction 2026-10-28: cells read like icon glyphs — white on the
|
|
234
|
+
// dark theme via rgb(var(--color-text)), the same vocabulary as
|
|
235
|
+
// HkIconButton; the token flips the ink in the light theme.
|
|
236
|
+
expect(contrastTextColor("#edc948")).toBe("rgb(var(--color-text, 30 30 30))");
|
|
237
|
+
expect(contrastTextColor("#4e79a7")).toBe("rgb(var(--color-text, 30 30 30))");
|
|
238
|
+
expect(contrastTextColor("not-a-color")).toBe("rgb(var(--color-text, 30 30 30))");
|
|
244
239
|
});
|
|
245
240
|
|
|
246
241
|
it("builds an accessible leaf-path summary from the same layout", () => {
|
|
@@ -144,21 +144,18 @@ function resolveOpaqueColor(raw: string, fallback: string): string {
|
|
|
144
144
|
return `rgb(${Math.round(channels[0])} ${Math.round(channels[1])} ${Math.round(channels[2])})`;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
0.7152 * linear(channels[1]) +
|
|
160
|
-
0.0722 * linear(channels[2]);
|
|
161
|
-
return luminance > 0.193 ? "#0b1220" : "#fff";
|
|
147
|
+
/**
|
|
148
|
+
* Cell label colour — user direction 2026-10-28: the text inside the colour
|
|
149
|
+
* blocks should read like the family's icon glyphs (WHITE on the dark
|
|
150
|
+
* theme), not a per-block black/white flip that made mid-tone cells carry
|
|
151
|
+
* dark text. So the foreground simply follows the theme's icon/text token
|
|
152
|
+
* (`--hi-icon-color` resolves to `rgb(var(--color-text))`), the same
|
|
153
|
+
* vocabulary HkIconButton uses; the light theme keeps dark ink via the same
|
|
154
|
+
* token. The background argument is kept for signature compatibility and
|
|
155
|
+
* intentionally unused.
|
|
156
|
+
*/
|
|
157
|
+
export function contrastTextColor(_background: string): string {
|
|
158
|
+
return "rgb(var(--color-text, 30 30 30))";
|
|
162
159
|
}
|
|
163
160
|
|
|
164
161
|
export const HK_TREEMAP_DEFAULT_COLORS = [
|