From 269f23a38789190d112b04e8e70c3a6d649193b1 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 14 Jun 2026 00:08:03 -0500 Subject: Update theme studio palette workflow --- scripts/theme-studio/samples.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/theme-studio/samples.py') diff --git a/scripts/theme-studio/samples.py b/scripts/theme-studio/samples.py index a854d6721..c80b0d405 100644 --- a/scripts/theme-studio/samples.py +++ b/scripts/theme-studio/samples.py @@ -327,5 +327,6 @@ html=f'''dupre revision — canonical< <table class="leg" id="legtable"><thead><tr><th></th><th onclick="srt(1)">color △</th><th onclick="srt(2)">hex △</th><th onclick="srt(3)">category △</th><th>example</th></tr></thead><tbody>{legend}</tbody></table> <h1>palette</h1> {palette}\n<script>let D={{}};function srt(c){{const t=document.querySelector("#legtable tbody");const r=[...t.rows];D[c]=!D[c];r.sort((a,b)=>{{const x=a.cells[c].innerText.trim().toLowerCase(),y=b.cells[c].innerText.trim().toLowerCase();return (x<y?-1:x>y?1:0)*(D[c]?1:-1)}});r.forEach(x=>t.appendChild(x))}}</script>''' -open("/tmp/dupre-canon.html","w").write(html) +with open("/tmp/dupre-canon.html","w") as out: + out.write(html) print("wrote /tmp/dupre-canon.html") -- cgit v1.2.3