@starasia/theme 3.3.1 → 3.5.0
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/dist/color/oklch.d.ts +2 -0
- package/dist/color/ramp.d.ts +7 -0
- package/dist/index.es.js +387 -258
- package/dist/index.umd.js +6 -5
- package/dist/theme/basePalette.d.ts +30 -0
- package/dist/theme/buildTheme.d.ts +15 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/presets.d.ts +35 -0
- package/package.json +1 -1
package/dist/color/oklch.d.ts
CHANGED
|
@@ -29,3 +29,5 @@ export declare function contrastRatio(hexA: string, hexB: string): number;
|
|
|
29
29
|
* Default kandidat putih vs ink gelap Starasia (gray-1100 #1e1f21).
|
|
30
30
|
*/
|
|
31
31
|
export declare function pickTextOn(bg: string, candidates?: string[]): string;
|
|
32
|
+
/** true bila warna tergolong gelap (luminance rendah) — penentu mode tema base. */
|
|
33
|
+
export declare function isDarkColor(hex: string): boolean;
|
package/dist/color/ramp.d.ts
CHANGED
|
@@ -30,5 +30,12 @@ export declare function rampFromSeed(seedHex: string, ladder: Ladder): string[];
|
|
|
30
30
|
* dibentuk parabola (puncak di tengah) supaya ujung putih/hitam tetap netral.
|
|
31
31
|
*/
|
|
32
32
|
export declare function neutralRamp(seedHex: string, ladderL: number[]): string[];
|
|
33
|
+
/**
|
|
34
|
+
* Ramp netral `n` langkah yang menginterpolasi LIGHTNESS dari `aHex` ke `bHex`
|
|
35
|
+
* (endpoint persis), hue tetap `hue`, chroma rendah membentuk tint lembut
|
|
36
|
+
* (parabola, puncak di tengah). Dipakai mesin tema-base: gray/surface diturunkan
|
|
37
|
+
* dari warna background supaya bg + permukaan + teks ikut berubah.
|
|
38
|
+
*/
|
|
39
|
+
export declare function rampBetween(aHex: string, bHex: string, n: number, hue: number, tintCap?: number): string[];
|
|
33
40
|
/** Pilih hex dari ramp yang Lightness-nya paling dekat ke target. */
|
|
34
41
|
export declare function pickByLightness(ramp: string[], targetL: number): string;
|