Repository navigation
Twelve palettes as shared data, contrast measured - #31
Merged
Merged
Conversation
src/data/palettes.ts takes the portal's six palettes (same slugs, same hexes) and adds a sibling to each direction. Roles, mood, culture, suits and style pairings for all twelve; contrast computed by paletteContrast() and re-measured by scripts/check-palettes.mjs, which prints the body hash the portal and console pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
src/data/palettes.tsis now the source for the colour palettes: the portal's six (same slugs, samecolorshexes, checked against a hard-coded copy of the portal's values) each followed by the sibling the colour guide names. Framework-free, header names the downstream copies (portalsrc/brand/palettes.data.ts, consolesrc/domain/palettes.data.ts) and carries the pin rule. README gets a "Palettes" section after "Style boards".Body SHA-256:
09fe8158686d3a78cc5d68675d4e45f209520f805debf7dbb88127d9db1cdae1How contrast works
paletteContrast(p)is pure and uses WCAG 2.x relative luminance.PALETTESis built from the data by adding its result, socontrastis never typed by hand. Ratios are truncated to two places (never rounded up), andpassesis judged against the pair's floor:AAat 4.5 or more,AA-largeat 3 or more where the floor is 3,failbelow the floor.scripts/check-palettes.mjsmeasures again independently and requires its numbers to match the file's. It fails if any new palette misses a floor. The originals' failures are listed exactly inKNOWN_FAILS, so a new failure fails the build, and so does a listed one that starts passing.colors: background, ink (text), primary and accent are unchanged. On-primary is whichever of background or text reads better on the primary. Muted is text mixed 30% toward background, and surface is background mixed 6% toward text.pairsWithis typed by aStyleIdunion written out in the file, so it can stay importless. The check holds that union equal toSTYLE_IDSin styles.ts. No palette has ademo, because no live demo site honestly uses one.The twelve (roles and measured contrast)
Contrast columns: ink/background · on-primary/primary · accent/background · muted/background. ✗ = under the floor.
Original palettes that fail a floor (hexes unchanged, shown as
fail)Five of the original six fail at least one floor. Only bold-modern passes all four.
#e63946, and white doesn't either.The accents are light golds and oranges, which work as fills behind dark text but not as text or marks on the light background. The downstream sites should use them that way, or show the
failbadge as the data says.npm run checkis green.🤖 Generated with Claude Code