mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-06 12:54:29 +01:00
- SKIN in MENU > DISPLAY after COLOR (COLORS by default; ui_skin, engine 15 byte 20 of the settings: older settings and unknown values load as COLORS; the editor's MENU id 21; DISPLAY now seven rows, the menu's TAB rows 17 apart, its MENU tiles 72 / 64 tall, ROWS 5-7). ux.skin follows it (style_apply); BOTTOM and HUD make SURF the background. - Palettes (tools/gen_ui_palettes.py): four knob colours each (KNOBS: the mock-up's for JIANT PAPER GREEN AMBER ICE, the rest in its spirit; GREY grey, MONO white; 4.5:1 on BG and SURF, 4:1 on RAISE checked), gfx.c T_K(c); JIANT's SURF the mock-up's near-black (10, 9, 14) and its RAISE 4 % (the 0.6 cards, #131218); its boxes rounded like the others (the black-SURF square case gone). JIANT's heat ramp the 0.6's (indigo violet red orange amber cream white). - Values and the header's BPM in a rounded sans again, as 0.6 (the mock-up's "Sans 0.6"): face M is Inter Tight SemiBold 15 px (assets/fonts, already credited), was Chakra Petch; labels, tabs, breadcrumb keep the 5 x 7 face. - The header (every skin, the mock-up's): the selected track's number in an ACCENT box, a THEME triangle playing, the BPM in M; HUD: no rule. The breadcrumb: the lens DIM, the level THEME, the set TEXT, the count TEXT. - COLORS: rounded tabs (THEME / RAISE), rounded RAISE cards with a 7 x 7 mark before the label where the label has one (CUT RES ATK REL WAVE DETUNE MIX NOISE STEP NOTE TYPE ACCENT SIZE DEPTH and kin), the label TEXT, the value and a 3 px rounded gauge in the knob's colour, the knob turned framed in it; the panel rounded. - BOTTOM: the tabs three words (the level's THEME with a pill), the panel the screen's width with no box (42..189; HOME's beings 240 x 148), the knobs a slim row over the breadcrumb (191..223: mark and label MID, the value in its colour, a hairline gauge); LINE draws its rules over and under the panel. - HUD: as BOTTOM; on HOME (ECO) the beings' water is the whole screen: every strip (header, tabs, the middle, the four cards 60 px each, the breadcrumb) is drawn each frame on the beings under it (ui_lzhome.c eco_draw / eco_backdrop: a being off the strip skipped; the numbers only in the middle), its words with a 1 px BG outline (gfx.c cv_halo), the level's word underlined; the knob row fades to 22 % 3 s after the last knob turn (ui.knob_ms) and is whole again at a turn. LOAD LITE / ECO pace the whole HUD frame as the panel's. - MENU > LARGE: COLORS' layout (the tall cards on top) in every skin, with the skin's tabs and colours. - Panels after the mock-up: EDIT > SOUND (the being larger, the scope a tile, the page's four parameters as chips in their knobs' colours, "2/2 CUT RES DRIVE" under them); FX > BUSES's tiles (lz_tile: COLORS rounded cards, the module framed THEME; BOTTOM / HUD bare, the module underlined); SEQ's bar cells and roll (BOTTOM / HUD: bare cells over a line, the beats only; the cursor framed TEXT); PUNCH's empty steps ticks; the dialogs (NOTICE, DICE) in the skin's tabs, cards and buttons; header messages in plain 5 x 7 words (the keycap gone). - CV_MAX 240 x 150 (HUD's middle). The new statics in the pool section, so the audio's data and code are where they were (target budgets identical to 0.8.8's). - Tests: ui_test SKIN (default, menu steps, saved / older / unknown, geometry, HUD's beings over the screen, the fade, every lens page in each skin); the menu, header, roll, editor and theme tests updated for SKIN, the box and Inter Tight; ui_render: every screen in BOTTOM and HUD (FLAT, LINE, LARGE, every palette) linted, their PNGs (JIANT PAPER GREY MONO), the draw cost per skin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
74 lines
4.1 KiB
Python
74 lines
4.1 KiB
Python
#!/usr/bin/env python3
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
# Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments
|
|
"""PPM -> PNG for the UI renders of tests/ui_render.c (Pillow). Under OUTDIR (default build/ui_new):
|
|
(the STEP page's piano roll scenes, roll_* step chance drum: also in build/ui_roll/<PALETTE>_<screen>.png)
|
|
<PALETTE>/<screen>.png 240 x 240, true size
|
|
sheet_<PALETTE>.png every screen of one palette, 1x, with its name
|
|
(MENU > STYLE: LINE_<PALETTE>/ and sheet_LINE_<PALETTE>.png for GREY MONO NIGHT PAPER;
|
|
MENU > LARGE: sheet_LARGE_GREY.png, sheet_LARGE_MONO.png, sheet_LARGE-LINE_GREY.png;
|
|
(0.8.9) MENU > SKIN: BOTTOM_<PALETTE>/, HUD_<PALETTE>/ and their sheets for JIANT PAPER GREY MONO)
|
|
With SLOTDIR (ui_render.py OUTDIR SLOTDIR): its filmstrips of the rolling digits, SLOTDIR/*.ppm -> *.png.
|
|
"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from PIL import Image, ImageDraw
|
|
|
|
out = Path(sys.argv[1] if len(sys.argv) > 1 else "build/ui_new")
|
|
shots = {}
|
|
for f in sorted((out / "ppm").glob("*.ppm")):
|
|
pal, name = f.stem.split("_", 1)
|
|
styled = pal in ("LINE", "LARGE", "LARGE-LINE", "BOTTOM", "HUD") # STYLE / MENU > LARGE / (0.8.9) SKIN renders: <STYLE>_<PALETTE>_<screen>
|
|
if styled:
|
|
p2, name = name.split("_", 1)
|
|
pal = f"{pal}_{p2}"
|
|
(out / pal).mkdir(parents=True, exist_ok=True)
|
|
img = Image.open(f).convert("RGB")
|
|
img.save(out / pal / f"{name}.png")
|
|
shots.setdefault(pal, []).append((name, img))
|
|
if styled:
|
|
continue
|
|
if pal in ("GREY", "MONO", "GREEN") and (name.startswith("perform_") or name == "menu_hold"): # the FX layer's screens
|
|
(out.parent / "ui_fx").mkdir(parents=True, exist_ok=True)
|
|
img.save(out.parent / "ui_fx" / f"{pal}_{name}.png")
|
|
if pal in ("GREY", "MONO", "GREEN") and (name.startswith("layer_") or name.startswith("perform_")): # the quick layers
|
|
(out.parent / "ui_layers").mkdir(parents=True, exist_ok=True)
|
|
img.save(out.parent / "ui_layers" / f"{pal}_{name}.png")
|
|
if name.startswith("roll_") or name in ("step", "chance", "drum"): # the STEP page's piano roll (and the grid)
|
|
(out.parent / "ui_roll").mkdir(parents=True, exist_ok=True)
|
|
img.save(out.parent / "ui_roll" / f"{pal}_{name}.png")
|
|
if pal in ("GREY", "MONO", "GREEN") and (name.startswith("name_") or name in ("project_named", "song_named", "user_foot")):
|
|
(out.parent / "ui_name").mkdir(parents=True, exist_ok=True) # NAME (src/ui_name.c) and the names it shows
|
|
img.save(out.parent / "ui_name" / f"{pal}_{name}.png")
|
|
for pal in ("GREY", "MONO", "GREEN"): # DIGITAL's 8 algorithm charts (+ OP LEVEL): x3, the panel, in build/ui_alg/
|
|
algs = [(n, im) for n, im in shots.get(pal, []) if n.startswith("alg_") or n == "op_level"]
|
|
if not algs:
|
|
continue
|
|
(out.parent / "ui_alg").mkdir(parents=True, exist_ok=True)
|
|
pw, ph, lh = 240 * 3, 122 * 3, 18
|
|
sheet = Image.new("RGB", (2 * pw + 24, ((len(algs) + 1) // 2) * (ph + lh + 8) + 8), (90, 90, 90))
|
|
d = ImageDraw.Draw(sheet)
|
|
for i, (name, img) in enumerate(algs):
|
|
big = img.resize((720, 720), Image.NEAREST)
|
|
big.save(out.parent / "ui_alg" / f"{pal}_{name}.png")
|
|
x, y = 8 + (i % 2) * (pw + 8), 8 + (i // 2) * (ph + lh + 8)
|
|
sheet.paste(big.crop((0, 76 * 3, pw, 198 * 3)), (x, y))
|
|
d.text((x, y + ph + 3), name.replace("alg_", "ALG "), fill=(235, 235, 235))
|
|
sheet.save(out.parent / "ui_alg" / f"sheet_{pal}.png")
|
|
for pal, items in shots.items():
|
|
cols, cw, ch = 8, 248, 262
|
|
rows = (len(items) + cols - 1) // cols
|
|
sheet = Image.new("RGB", (cols * cw + 8, rows * ch + 8), (90, 90, 90))
|
|
d = ImageDraw.Draw(sheet)
|
|
for i, (name, img) in enumerate(items):
|
|
x, y = 8 + (i % cols) * cw, 8 + (i // cols) * ch
|
|
sheet.paste(img, (x, y))
|
|
d.text((x, y + 242), name, fill=(235, 235, 235))
|
|
sheet.save(out / f"sheet_{pal}.png")
|
|
print(f"ui_render: PNGs in {out}/<palette>/ and {out}/sheet_<palette>.png")
|
|
if len(sys.argv) > 2:
|
|
for f in sorted(Path(sys.argv[2]).glob("*.ppm")):
|
|
Image.open(f).convert("RGB").save(f.with_suffix(".png"))
|
|
print(f"ui_render: rolling-digit filmstrips in {sys.argv[2]}/*.png")
|