Take the camera viewshed colours and volume builder off Cesium

The viewshed palette is renderer colours from a new hslColor in
render/color, which computes as the renderer's own fromHsl does (the CSS
HSL reading now goes through it). The volume primitive builder moves,
unchanged, into the camera layer's rendering part, which converts each
record's palette to Cesium colours once and draws the lines and volumes
with them as before. Tests check the palette against the renderer's
colours exactly.

cctvViewshed leaves the allow-list.
This commit is contained in:
Sameh Khamis committed 2026-11-06 23:47:17 -08:00
1 parent 0f496b9ae8
commit 2443028d0f
6 files changed
+130 -73

No files matched your search

+15
View File
@@ -29,3 +29,18 @@ test('CSS colours read as the default renderer reads them', async () => {
assert.equal(cssColor('not a colour'), null);
assert.equal(cssColor(undefined), null);
});
test('HSL colours read as the default renderer computes them', async () => {
const Cesium = await import('cesium');
const { hslColor } = await import('./color.js');
for (const [h, s, l, a] of [
[0, 0.85, 0.6, 0.12],
[0.3819660112501051, 0.9, 0.65, 0.85],
[0.7639320225002102, 0.9, 0.7, 1],
[1.25, 0.5, 0.25, 0.4],
[0.5, 0, 0.4, 1],
]) {
const c = Cesium.Color.fromHsl(h, s, l, a);
assert.deepEqual(hslColor(h, s, l, a), [c.red, c.green, c.blue, c.alpha]);
}
});