From 7c84f7a91643f5773bc00f53c0ded09c3f8f2b69 Mon Sep 17 00:00:00 2001 From: Kevin Deng Date: Mon, 24 Aug 2026 04:20:33 +0900 Subject: [PATCH] Improve overprint color separation and density handling (#62) --- .gitignore | 3 ++ app/components/HeroOverprint.vue | 27 +++++++++++++--- app/components/LitRegions.vue | 7 +++- app/components/OverprintChar.vue | 34 +++++++++++++------- app/locales/ja-jp.ts | 2 +- app/locales/ko-kr.ts | 2 +- app/locales/zh-cn.ts | 3 +- app/locales/zh-hk.ts | 3 +- app/locales/zh-tw.ts | 3 +- app/styles/overprint.css | 55 ++++++++++++++++---------------- app/styles/vars.css | 48 ++++++++++++++-------------- app/utils/overprint.ts | 34 ++++++++++++++++++++ 12 files changed, 147 insertions(+), 74 deletions(-) create mode 100644 app/utils/overprint.ts diff --git a/.gitignore b/.gitignore index d0bf8a9..2f78989 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ dist .DS_Store .eslintcache +# Local Impeccable live-design session state. +.impeccable/live/ + # Cached downloads of external sources, verified against data/sources.lock.json data/raw/ diff --git a/app/components/HeroOverprint.vue b/app/components/HeroOverprint.vue index 247776b..3c0862b 100644 --- a/app/components/HeroOverprint.vue +++ b/app/components/HeroOverprint.vue @@ -11,6 +11,7 @@ import { useMorphingKey, useMorphTo, } from '~/composables/chars.ts' +import { overprintColor, overprintOpacity } from '~/utils/overprint.ts' const { t, list, locale } = useT() const { flagsOn, outlineOn, visibleRegions, regionIndices } = usePrefs() @@ -94,6 +95,20 @@ const groupCount = computed( () => new Set(forms.value.map((form) => form.group)).size, ) +/** + * A uniform character needs no color encoding and remains ordinary ink. Once + * forms differ, every distinct shape takes an equal color from the same fixed + * five-ink sequence; dense rows lower all plates together rather than + * favoring one of them. + */ +const plateOpacity = computed(() => + groupCount.value === 1 + ? 1 + : overprintOpacity(shown.value, visibleRegions.value), +) +const plateColor = (group: number) => + groupCount.value === 1 ? 'var(--c-ink)' : overprintColor(group) + /** * Walking the forms is the stacked view answering "how many are in here". Once * they are separated the row answers that by itself, and lighting one of them @@ -223,7 +238,7 @@ async function openFromField(event: KeyboardEvent) {