@tenphi/glaze 0.0.0-snapshot.365f18a → 0.0.0-snapshot.38d4d4e
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/AGENTS.md +132 -0
- package/README.md +3 -2
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/docs/api.md +11 -7
- package/package.json +11 -2
package/dist/index.d.cts
CHANGED
|
@@ -1699,8 +1699,10 @@ declare function okhslToOkhst(c: {
|
|
|
1699
1699
|
/**
|
|
1700
1700
|
* Edge adapter: a resolved variant stores canonical tone `t` (0–1). Convert
|
|
1701
1701
|
* it to the OKHSL `{ h, s, l }` the formatters and luminance pipeline expect —
|
|
1702
|
-
* `s` and `l` on the same 0–1 factor scale, so
|
|
1703
|
-
* into `formatOkhsl` / `formatRgb` /
|
|
1702
|
+
* `s` and `l` on the same 0–1 factor scale, so `const { h, s, l } =
|
|
1703
|
+
* variantToOkhsl(v)` destructures straight into `formatOkhsl` / `formatRgb` /
|
|
1704
|
+
* `okhslToLinearSrgb` with no rescaling. `alpha` stays on the variant; use
|
|
1705
|
+
* `glaze.format(v, format)` for a string that carries it.
|
|
1704
1706
|
*/
|
|
1705
1707
|
declare function variantToOkhsl(v: {
|
|
1706
1708
|
h: number;
|
package/dist/index.d.mts
CHANGED
|
@@ -1699,8 +1699,10 @@ declare function okhslToOkhst(c: {
|
|
|
1699
1699
|
/**
|
|
1700
1700
|
* Edge adapter: a resolved variant stores canonical tone `t` (0–1). Convert
|
|
1701
1701
|
* it to the OKHSL `{ h, s, l }` the formatters and luminance pipeline expect —
|
|
1702
|
-
* `s` and `l` on the same 0–1 factor scale, so
|
|
1703
|
-
* into `formatOkhsl` / `formatRgb` /
|
|
1702
|
+
* `s` and `l` on the same 0–1 factor scale, so `const { h, s, l } =
|
|
1703
|
+
* variantToOkhsl(v)` destructures straight into `formatOkhsl` / `formatRgb` /
|
|
1704
|
+
* `okhslToLinearSrgb` with no rescaling. `alpha` stays on the variant; use
|
|
1705
|
+
* `glaze.format(v, format)` for a string that carries it.
|
|
1704
1706
|
*/
|
|
1705
1707
|
declare function variantToOkhsl(v: {
|
|
1706
1708
|
h: number;
|
package/dist/index.mjs
CHANGED
|
@@ -593,12 +593,10 @@ function fmt$1(value, decimals) {
|
|
|
593
593
|
* percentage-scale input, so warn about it loudly rather than emit a wrong
|
|
594
594
|
* color quietly.
|
|
595
595
|
*/
|
|
596
|
-
const SCALE_WARN_CACHE_LIMIT = 32;
|
|
597
596
|
const scaleWarnCache = /* @__PURE__ */ new Set();
|
|
598
597
|
function warnPercentScale(fn, ...values) {
|
|
599
598
|
if (!values.some((v) => v > 1.000001)) return;
|
|
600
599
|
if (!scaleWarnCache.has(fn)) {
|
|
601
|
-
if (scaleWarnCache.size >= SCALE_WARN_CACHE_LIMIT) scaleWarnCache.clear();
|
|
602
600
|
scaleWarnCache.add(fn);
|
|
603
601
|
console.warn(`glaze: ${fn}() got a value above 1 — it takes the 0-1 factors every Glaze producer returns (resolve(), variantToOkhsl, srgbToOkhsl), not 0-100 percentages. Divide by 100, or drop the "* 100" left over from the pre-2.0 signature.`);
|
|
604
602
|
}
|
|
@@ -1147,8 +1145,10 @@ function okhslToOkhst(c) {
|
|
|
1147
1145
|
/**
|
|
1148
1146
|
* Edge adapter: a resolved variant stores canonical tone `t` (0–1). Convert
|
|
1149
1147
|
* it to the OKHSL `{ h, s, l }` the formatters and luminance pipeline expect —
|
|
1150
|
-
* `s` and `l` on the same 0–1 factor scale, so
|
|
1151
|
-
* into `formatOkhsl` / `formatRgb` /
|
|
1148
|
+
* `s` and `l` on the same 0–1 factor scale, so `const { h, s, l } =
|
|
1149
|
+
* variantToOkhsl(v)` destructures straight into `formatOkhsl` / `formatRgb` /
|
|
1150
|
+
* `okhslToLinearSrgb` with no rescaling. `alpha` stays on the variant; use
|
|
1151
|
+
* `glaze.format(v, format)` for a string that carries it.
|
|
1152
1152
|
*/
|
|
1153
1153
|
function variantToOkhsl(v) {
|
|
1154
1154
|
return {
|