This document summarizes the current v0.4 branch implementation. The complete planning specification lives in planning/v0.4/v0.4-palette-kit-spec.md.
The package root exposes:
createPaletteKitsoftResolverConfigneutralResolverConfigstrongResolverConfigdefaultResolverConfig- public TypeScript types
The package root does not expose CLI commands, subpath exporters, serializer functions, validators, or internal resolver helpers.
createPaletteKit({
context: "light",
output: "oklch",
intents: {
brand: { hue: 260, chroma: 0.14 },
neutral: { hue: 0, chroma: 0 },
},
});The public config supports:
intentscontextsystemDefaultContextoutputsystemDefaultOutputpresetresolverConfig
palette.resolve accepts:
usageintentlevelonoverunderstatestateDirectioncontextoutput
The resolver is deterministic and resolves internally in OKLCH.
oklchoklabsrgbp3hexrgba
RGB-like outputs use clipped 8-bit channels. p3 uses Display-P3 conversion
and the current explicit clip gamut strategy.
- Same input produces the same output.
- Output format does not change internal OKLCH resolution.
- Context is explicit and never inferred.
- Context affects structural level curves while preserving semantic intent.
- Level is explicit and never inferred.
- Non-default state requires
stateDirection. - Forbidden axis combinations throw.
onenforces APCA contrast with a default Lc 60 target and exposes WCAG as a fallback diagnostic.- Relation targets accept normalized OKLCH or any serialized Palette Kit output and are normalized back to OKLCH before relation logic runs.
overapplies configured alpha by level.underapplies configured alpha and luminance reduction by level.- State alpha deltas apply only where alpha is allowed, currently
overlays. - Intent names are semantic-only and cannot encode usage, state, relation, level, or visual implementation details.
- CLI and exporters are not public in v0.4.