From 1ea434e9a7073275519b7c87642b6cd397aea9d0 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 8 Jun 2026 03:23:48 -0400 Subject: [PATCH] Brightness as a continuous rhyme-strength gradient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fill (and tail underline) now scale through a per-group strength from the founding key: perfect 1.0, multisyllabic .82, consonant- backed .7, vowel slant .6, consonance .55, weak ending .5. So the page reads rhyme quality as a smooth brightness ramp, not just perfect-vs-slant — the feature, deepened. Co-Authored-By: Claude Opus 4.8 (1M context) --- app.py | 9 ++++++++- static/index.html | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index e280712..17d8162 100644 --- a/app.py +++ b/app.py @@ -1258,8 +1258,15 @@ def analyze(draft: Draft): usage[color] += 1 chosen.append(color) sound = re.sub(r"^[a-z0-9]+:", "", g["key"]).replace("|", " ").lower() + k = g["key"] + strength = (1.0 if k.startswith("p:") # perfect rime + else 0.82 if k.startswith("m:") # multisyllabic run + else 0.7 if k.startswith("m2:") # consonant-backed + else 0.6 if k.startswith("v:") # vowel slant + else 0.55 if k.startswith("c:") # consonance + else 0.5) # weak ending groups_out.append({"id": gid, "color": color, "slant": g["slant"], - "sound": sound}) + "sound": sound, "strength": round(strength, 2)}) # stanza rhyme schemes from line-ending groups: the token covering # the most of the line's tail owns the slot — Em rhymes "-cock it", diff --git a/static/index.html b/static/index.html index a1a0342..2b8a0b2 100644 --- a/static/index.html +++ b/static/index.html @@ -636,7 +636,8 @@ function render(){ : (p && (focusGid === null || p.g === focusGid)) ? p : (w || p); let alpha = !t.ph ? (t.end ? 34 : 19) : (t.end ? 24 : 14); - if(t.slant) alpha = Math.round(alpha * 0.62); // slant sits back + const str = (groupInfo[t.g] && groupInfo[t.g].strength) || 1; + alpha = Math.round(alpha * (0.45 + 0.55 * str)); // brightness = rhyme strength if(focusGid !== null && t.g === focusGid){ alpha = Math.min(85, Math.round(alpha * 2.8)); style += 'color:#1a120c;font-weight:600;'; // dark ink on the lit chip @@ -645,7 +646,7 @@ function render(){ // faint underline on the rhyming tail (rs..e) of a word — a // whisper of precision under the full-word fill if(w && w.rs != null && a >= w.rs){ - const u = w.slant ? 28 : 42; + const u = Math.round(42 * ((groupInfo[w.g] && groupInfo[w.g].strength) || 1)); shadows.push(`inset 0 -1.5px 0 0 color-mix(in srgb, ${colorOf(w)} ${u}%, transparent)`); } }else if(op){