From f5a26261968dec3d11f54d73f3a83f32450f2955 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Aug 2026 04:14:08 +0000 Subject: [PATCH] Use the published Wallace threadcount, and scale the weave to the sett MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two separate faults. The pattern was wrong, and the scale was broken. Pattern: the sett is published as K/4 R32 K32 Y/4, the slashes marking pivots, which reflects out to K4 R32 K32 Y4 K32 R32 — 136 threads, about half black and half red with a yellow line worth 3%. I had the structure inverted: the yellow overstripe belongs down the centre of a wide black band, and the narrow black guard belongs between two red blocks. Mine put yellow between narrow blacks and the wide black elsewhere, which is why it read as a generic check rather than as Wallace. Scale: thread width was a fixed fraction of the screen while the sett grew from 84 threads to 216, so a repeat became 933dp on a 360dp phone and only 0.39 of one was ever visible. The cloth had zoomed into a few enormous blocks and stopped being a weave at all — that is the part that got worse, not the colours. Thread width is now derived from the sett, so a couple of full repeats are on screen whatever the threadcount says, and changing the count rescales instead of silently magnifying. The icon is generated from the same numbers at one repeat across the adaptive safe zone. Threadcount cross-checked against two independent sources rather than guessed; recorded in Tartan.kt and the README so the next change starts from the published figures. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015qjfMiPUDshdKEUa6vxqzN --- README.md | 17 ++-- .../org/prolibertate/games/ui/SplashScreen.kt | 8 +- .../org/prolibertate/games/ui/theme/Tartan.kt | 44 ++++++--- .../res/drawable/ic_launcher_background.xml | 93 +++++++++---------- app/src/main/res/mipmap/ic_launcher.xml | 93 +++++++++---------- app/src/main/res/mipmap/ic_launcher_round.xml | 93 +++++++++---------- 6 files changed, 183 insertions(+), 165 deletions(-) diff --git a/README.md b/README.md index fa0ea67..43b356b 100644 --- a/README.md +++ b/README.md @@ -70,14 +70,15 @@ drawable, so it stays sharp at every density and needs no PNGs. Two honest caveats: -- **The sett is matched by eye, not to a registered threadcount.** - `WallaceSett` is written as a half-sett and reflected about its pivots, the way - a threadcount is published: gold 6, black 6, red 36, black 24, red 36, black 6. - That gives a red ground at about two thirds, black bands alternating wide and - narrow, and one thin gold overstripe per repeat flanked by black — matched - against a reference swatch rather than to the Scottish Register of Tartans. - Substituting registered counts is an edit to that one list; the icon is - generated from the same numbers, so both follow. +- **The sett is the published threadcount: `K/4 R32 K32 Y/4`.** The slashes are + pivots, so `WallaceSett` holds the half-sett and reflects it out to + `K4 R32 K32 Y4 K32 R32` — 136 threads, about half black, half red, with a + yellow line worth 3%. Two details define the pattern and are easy to get + backwards: the yellow overstripe runs down the *centre of a wide black band*, + and the narrow black guard sits *between two red blocks*. The icon is + generated from the same numbers, so the icon and the splash cannot drift. + Weave scale is derived from the sett rather than fixed, so changing the + threadcount rescales both instead of silently zooming in. - **The typeface is bundled under a licence.** Uncial Antiqua, © 2011 Brian J. Bonislawsky DBA Astigmatic, Reserved Font Name "Uncial Antiqua", used under the SIL Open Font License 1.1. The full licence is at diff --git a/app/src/main/java/org/prolibertate/games/ui/SplashScreen.kt b/app/src/main/java/org/prolibertate/games/ui/SplashScreen.kt index e3f1ce8..fd3aff5 100644 --- a/app/src/main/java/org/prolibertate/games/ui/SplashScreen.kt +++ b/app/src/main/java/org/prolibertate/games/ui/SplashScreen.kt @@ -31,6 +31,7 @@ import androidx.compose.ui.unit.sp import kotlinx.coroutines.delay import org.prolibertate.games.R import org.prolibertate.games.ui.theme.TartanBackground +import org.prolibertate.games.ui.theme.threadWidthFor /** How long the splash holds at full opacity before fading. */ private const val SPLASH_HOLD_MILLIS = 2_000L @@ -75,9 +76,10 @@ fun SplashScreen( // longer in scope. val shortestSide = minOf(maxWidth, maxHeight).value - // Weave scale follows the screen so the cloth reads the same on a phone - // and a tablet rather than turning into a fine grid on a large display. - val threadWidth = (shortestSide * 0.012f).dp + // Weave scale is derived from the sett, not a fixed fraction, so a + // couple of full repeats are always on screen whatever the threadcount + // says and whatever the display is. + val threadWidth = threadWidthFor(across = shortestSide.dp, repeats = 2f) val titleSize = (shortestSide * 0.13f).sp TartanBackground( modifier = Modifier.fillMaxSize(), diff --git a/app/src/main/java/org/prolibertate/games/ui/theme/Tartan.kt b/app/src/main/java/org/prolibertate/games/ui/theme/Tartan.kt index 4b64261..af4aaa2 100644 --- a/app/src/main/java/org/prolibertate/games/ui/theme/Tartan.kt +++ b/app/src/main/java/org/prolibertate/games/ui/theme/Tartan.kt @@ -31,24 +31,42 @@ fun List.pivoted(): List = if (size < 3) this else this + drop(1).dropLast(1).reversed() /** - * The Wallace sett, as a half-sett between the gold line and the centre of a - * narrow black guard. + * The Wallace sett, from its published threadcount: **K/4 R32 K32 Y/4**. * - * Matched by eye to a reference swatch rather than to a registered - * threadcount: red ground, black bands alternating wide and narrow, and one - * thin gold overstripe per repeat, flanked by black on both sides. The - * proportions are the point — swapping in registered counts is an edit to this - * list and nothing else. + * The slashes mark the pivots, so this is the half-sett and it reflects out to + * `K4 R32 K32 Y4 K32 R32` — 136 threads, roughly half black, half red, with a + * yellow line worth 3%. Two consequences that are easy to get backwards and + * that define the pattern: + * + * - the yellow overstripe runs down the **centre of a wide black band**, not + * between red and black; + * - the narrow black guard sits **between two red blocks**, splitting the red + * into pairs. */ val WallaceSett: List = listOf( - TartanStripe(WallaceGold, 6), - TartanStripe(WallaceBlack, 6), - TartanStripe(WallaceRed, 36), - TartanStripe(WallaceBlack, 24), - TartanStripe(WallaceRed, 36), - TartanStripe(WallaceBlack, 6), + TartanStripe(WallaceBlack, 4), + TartanStripe(WallaceRed, 32), + TartanStripe(WallaceBlack, 32), + TartanStripe(WallaceGold, 4), ).pivoted() +/** Threads in one full repeat of a sett. */ +val List.threadsPerRepeat: Int get() = sumOf { it.threads } + +/** + * The thread width that fits [repeats] repeats of [sett] across [across]. + * + * Scale has to be derived from the sett rather than fixed, because changing a + * threadcount changes how many threads a repeat contains — a fixed width and a + * larger sett silently zooms in until the cloth is a couple of enormous blocks + * and stops reading as tartan at all. + */ +fun threadWidthFor( + sett: List = WallaceSett, + across: Dp, + repeats: Float = 2f, +): Dp = across / (sett.threadsPerRepeat * repeats) + /** * Draws a tartan by laying the sett down vertically as warp, then across as * weft at half opacity. The overlap is what produces the blended squares and diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml index fe1cad3..0b06f99 100644 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -2,13 +2,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/mipmap/ic_launcher.xml b/app/src/main/res/mipmap/ic_launcher.xml index b671e0e..22102a1 100644 --- a/app/src/main/res/mipmap/ic_launcher.xml +++ b/app/src/main/res/mipmap/ic_launcher.xml @@ -2,13 +2,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/mipmap/ic_launcher_round.xml b/app/src/main/res/mipmap/ic_launcher_round.xml index b671e0e..22102a1 100644 --- a/app/src/main/res/mipmap/ic_launcher_round.xml +++ b/app/src/main/res/mipmap/ic_launcher_round.xml @@ -2,13 +2,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +