JSPM

@simple-prism/core

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 578
  • Score
    100M100P100Q14044F
  • License MIT

Generate a harmonious, contrast-aware design-token system from one or a few seed colors.

Package Exports

  • @simple-prism/core

Readme

@simple-prism/core

从一个(或几个)种子色,生成协调、可读、明暗双全的设计令牌系统。OKLCH-first,APCA 对比度求解。

Prism 的核心引擎 —— 只产颜色,落地交给适配器。

安装

npm i @simple-prism/core

用法

import { generateTheme } from "@simple-prism/core";

const theme = generateTheme({ primary: "#3b82f6" });
theme.scales.primary.light.steps[500].hex; // "#3b82f6"
  • 11 阶色板(50–950)+ Radix 式角色合约;
  • 种子色原样钉入最近一阶,暗色是镜像明度阶,文字色用 APCA 求解;
  • 另含 generateScale、调和、对比度、simulateCvdformatRgb/formatHsl 等工具。

适配器@simple-prism/css · @simple-prism/tailwind · @simple-prism/scss · @simple-prism/tokens

完整文档见仓库。MIT。