@webmate-studio/builder 0.2.139 → 0.2.140
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/package.json +1 -1
- package/src/design-tokens-v2.js +23 -11
package/package.json
CHANGED
package/src/design-tokens-v2.js
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
* chromaScale = globaler Sättigungsmultiplikator
|
|
17
17
|
*/
|
|
18
18
|
export const COLOR_SCALE_PRESETS = {
|
|
19
|
-
vivid: { label: 'Leuchtend', stdDev:
|
|
19
|
+
vivid: { label: 'Leuchtend', stdDev: 50, chromaScale: 1.2 },
|
|
20
20
|
natural: { label: 'Natürlich', stdDev: 30, chromaScale: 1.0 },
|
|
21
|
-
soft: { label: 'Pastellig', stdDev:
|
|
22
|
-
muted: { label: 'Gedämpft', stdDev: 22, chromaScale: 0.
|
|
21
|
+
soft: { label: 'Pastellig', stdDev: 18, chromaScale: 0.7 },
|
|
22
|
+
muted: { label: 'Gedämpft', stdDev: 22, chromaScale: 0.5 },
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -316,9 +316,23 @@ function buildDarkLightnessRamp(darkBaseL) {
|
|
|
316
316
|
* sind — wie bei Radix Colors.
|
|
317
317
|
*/
|
|
318
318
|
function computeChroma(stepL, baseL, baseC, stdDev, chromaScale) {
|
|
319
|
-
// Gaußkurve:
|
|
319
|
+
// Gaußkurve mit Plateau: In der Nähe der Base bleibt Chroma nahe 100%,
|
|
320
|
+
// erst weiter entfernt greift die Gaußkurve richtig.
|
|
321
|
+
// Das verhindert den harten Sprung bei Steps 8/10 vs. Base.
|
|
320
322
|
const diff = baseL - stepL;
|
|
321
|
-
const
|
|
323
|
+
const absDiff = Math.abs(diff);
|
|
324
|
+
|
|
325
|
+
// Plateau-Radius: Innerhalb dieses L-Abstands bleibt Chroma nahe Base-Level
|
|
326
|
+
const plateau = 0.08;
|
|
327
|
+
let gaussian;
|
|
328
|
+
if (absDiff <= plateau) {
|
|
329
|
+
// Innerhalb des Plateaus: sanfter cosinus-Übergang (1.0 → ~0.97)
|
|
330
|
+
gaussian = 1.0 - 0.03 * (absDiff / plateau);
|
|
331
|
+
} else {
|
|
332
|
+
// Außerhalb: Gauß ab der Plateau-Kante
|
|
333
|
+
const edgeDiff = absDiff - plateau;
|
|
334
|
+
gaussian = 0.97 * Math.exp((-12 / stdDev) * edgeDiff * edgeDiff);
|
|
335
|
+
}
|
|
322
336
|
|
|
323
337
|
// Lightness-Begrenzung: Asymmetrisch
|
|
324
338
|
// Helle Seite (L > 0.85): Chroma fällt steil auf 0 → Steps 1-2 bleiben fast weiß
|
|
@@ -326,13 +340,11 @@ function computeChroma(stepL, baseL, baseC, stdDev, chromaScale) {
|
|
|
326
340
|
// Mitte (0.3-0.85): Nahezu volle Chroma möglich
|
|
327
341
|
let lightnessLimit;
|
|
328
342
|
if (stepL > 0.85) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
lightnessLimit = 1.0 - t * t; // quadratic drop
|
|
343
|
+
const t = (stepL - 0.85) / 0.15;
|
|
344
|
+
lightnessLimit = 1.0 - t * t;
|
|
332
345
|
} else if (stepL < 0.3) {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
lightnessLimit = t * t; // quadratic rise
|
|
346
|
+
const t = stepL / 0.3;
|
|
347
|
+
lightnessLimit = t * t;
|
|
336
348
|
} else {
|
|
337
349
|
lightnessLimit = 1.0;
|
|
338
350
|
}
|