import json, os HERE=os.path.dirname(os.path.abspath(__file__)) # Pure color-math core, inlined verbatim into the page so the browser runs the # same code the Node tests import (one source of truth). Strip the ES-module # `export` line(s) — a top-level export is a syntax error in a classic """ HTML=(HTML.replace("COLORMATH_J",COLORMATH_BODY) .replace("SAMPLES_J",json.dumps(SAMPLES)) .replace("PALETTE_J",json.dumps(PALETTE)).replace("CATS_J",json.dumps(CATS)) .replace("UIFACES_J",json.dumps(UI_FACES)).replace("UIMAP_J",json.dumps(UIMAP)).replace("APPS_J",json.dumps(APPS)) .replace("BOLD_J",json.dumps(BOLD)).replace("MAP_J",json.dumps(MAP))) OUT=os.path.join(HERE,'theme-studio.html') open(OUT,"w").write(HTML) print("wrote",OUT)