@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmate-studio/builder",
3
- "version": "0.2.139",
3
+ "version": "0.2.140",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -16,10 +16,10 @@
16
16
  * chromaScale = globaler Sättigungsmultiplikator
17
17
  */
18
18
  export const COLOR_SCALE_PRESETS = {
19
- vivid: { label: 'Leuchtend', stdDev: 40, chromaScale: 1.15 },
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: 16, chromaScale: 0.75 },
22
- muted: { label: 'Gedämpft', stdDev: 22, chromaScale: 0.55 },
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: Peak bei baseL, flachere Flanken als vorher
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 gaussian = Math.exp((-12 / stdDev) * diff * diff);
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
- // Steep falloff for near-white steps
330
- const t = (stepL - 0.85) / 0.15; // 0 at L=0.85, 1 at L=1.0
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
- // Moderate falloff for near-black steps
334
- const t = stepL / 0.3; // 0 at L=0, 1 at L=0.3
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
  }