@slotted/theme 0.1.0-beta.0 → 0.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/conformance/theme-conformance.mjs +21 -1
- package/dist/index.js +2475 -651
- package/dist/{seeds-x76IGbQO.js → seeds-CaieGmB9.js} +1 -0
- package/dist/seeds.js +1 -1
- package/dist/types/contract-types.d.ts +2 -0
- package/dist/types/gamut.d.ts +37 -0
- package/dist/types/generated/contract.d.ts +4 -4
- package/dist/types/index.d.ts +2 -0
- package/dist/types/recipe.d.ts +8 -2
- package/dist/types/seeds.d.ts +1 -1
- package/dist/types/token-groups.d.ts +21 -0
- package/package.json +1 -1
- package/src/contract.json +716 -0
package/dist/seeds.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./seeds-
|
|
1
|
+
import { n as e, t } from "./seeds-CaieGmB9.js";
|
|
2
2
|
export { t as SEED_NAMES, e as seedStyle };
|
|
@@ -7,6 +7,8 @@ export interface TokenDefinition {
|
|
|
7
7
|
readonly literal?: string;
|
|
8
8
|
readonly forcedColor?: string;
|
|
9
9
|
readonly reducedMotion?: boolean;
|
|
10
|
+
/** The value under `prefers-reduced-transparency: reduce`, the same in every theme. */
|
|
11
|
+
readonly reducedTransparency?: string;
|
|
10
12
|
}
|
|
11
13
|
export interface TokenContract {
|
|
12
14
|
readonly schemaVersion: number;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The most chroma sRGB holds at one lightness, as a function of the hue.
|
|
3
|
+
*
|
|
4
|
+
* A colour turned from a seed by a fixed hue offset can land on any hue, and
|
|
5
|
+
* the chroma sRGB holds at a lightness ranges from 0.1 (cyan) to over 0.25
|
|
6
|
+
* (red, violet) at 0.6. A single chroma low enough for every hue paints every
|
|
7
|
+
* other hue grey; a single chroma high enough for the reds leaves the screen
|
|
8
|
+
* to clip the cyans, which moves their hue and their lightness. The limit is
|
|
9
|
+
* a fourth-order Fourier series in the hue, fitted over every degree and
|
|
10
|
+
* moved by its largest overshoot toward the inside, so it never admits a
|
|
11
|
+
* colour the gamut refuses.
|
|
12
|
+
*/
|
|
13
|
+
export interface ChromaLimit {
|
|
14
|
+
/** The chroma asked for, where sRGB holds it. */
|
|
15
|
+
readonly max: number;
|
|
16
|
+
/** The fitted limit's Fourier coefficients: `k0 + Σ k(2n−1)·cos nh + k(2n)·sin nh`. */
|
|
17
|
+
readonly gamut: readonly number[];
|
|
18
|
+
}
|
|
19
|
+
export declare const LIMIT_HARMONICS = 4;
|
|
20
|
+
/** The limit's value at one hue, from the coefficients as `fmt` writes them. */
|
|
21
|
+
export declare function gamutChroma(gamut: readonly number[], h: number): number;
|
|
22
|
+
/** The chroma a limited derivation paints at one hue. */
|
|
23
|
+
export declare function limitedChroma(limit: ChromaLimit, h: number): number;
|
|
24
|
+
/**
|
|
25
|
+
* The fitted limit at one lightness. The constant term is lowered by the
|
|
26
|
+
* largest overshoot of the rounded series over the exact limit, and a margin
|
|
27
|
+
* of 0.002, so every hue it admits is painted as derived.
|
|
28
|
+
*/
|
|
29
|
+
export declare function fitGamut(l: number): readonly number[];
|
|
30
|
+
/**
|
|
31
|
+
* The limited colour in CSS. The seed is turned to the hue at chroma 1, so
|
|
32
|
+
* the `a` and `b` of its OKLab form are the hue's cosine and sine; the series
|
|
33
|
+
* is a polynomial of the two (cos nh = T_n(a), sin nh = b · U_{n−1}(a)), and
|
|
34
|
+
* scaling `a` and `b` by the limited chroma paints it. No trigonometric
|
|
35
|
+
* function reads a channel keyword: Firefox 146–152 refuses them.
|
|
36
|
+
*/
|
|
37
|
+
export declare function limitedColorCss(seed: string, l: string, h: string, limit: ChromaLimit): string;
|