Skip to content

Commit

Permalink
Update color space diagram, make it dynamic and make it part of the b…
Browse files Browse the repository at this point in the history
…uild process (except the d2 -> SVG step)
  • Loading branch information
LeaVerou committed Oct 2, 2024
1 parent 4ebc53f commit f8e5a45
Show file tree
Hide file tree
Showing 9 changed files with 941 additions and 8 deletions.
22 changes: 22 additions & 0 deletions assets/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,28 @@ main {
}
}

#space-tree {
width: 100%;

svg {
width: 100%;
overflow: visible;
}



.node text {
font-weight: 500;
font-size: 44px !important;
}

.root text {
font-weight: bold;
font-size: 66px !important;
translate: 0 -10px;
}
}

.color-space {
display: grid;
grid-template-columns: 1fr auto;
Expand Down
10 changes: 5 additions & 5 deletions data/spaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const modules = JSON.parse(readFileSync("data/modules.json"));

let spaces = {};

for (let meta of modules.space) {
let id = meta.id;
let space = ColorSpace.registry[id];
modules.space = Object.fromEntries(modules.space.map(meta => [meta.id, meta]));

spaces[id] = meta;
Object.assign(meta, {
for (let id in ColorSpace.registry) {
let space = ColorSpace.registry[id];
let meta = spaces[id] = Object.assign(modules.space[id] ?? {}, {
name: space.name,
white: whitePoints.find(([name, white]) => white === space.white)?.[0] ?? "D65",
base: space.base,
coords: space.coords,
Expand Down
18 changes: 18 additions & 0 deletions docs/images/spaces-fixup.brep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
files: spaces.svg

replace:
- {
regexp: true,
from: '<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">.+?</svg>',
to: ''
}
- {
regexp: true,
from: '@font-face \{.+?\}',
to: ''
}
- {
regexp: true,
from: 'font-family: .+?;',
to: ''
}
Loading

0 comments on commit f8e5a45

Please sign in to comment.