@lokiyou/pi-nano-footer 0.10.0 → 0.11.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/index.ts +8 -3
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -80,9 +80,14 @@ Editor.prototype.render = function (width: number): string[] {
|
|
|
80
80
|
const saved = this.borderColor;
|
|
81
81
|
const rgb = extractRGB(saved);
|
|
82
82
|
if (rgb) {
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
//
|
|
83
|
+
let [r, g, b] = rgb;
|
|
84
|
+
// 智能工作色:向暖橙 #ff9f1c 偏移 40%
|
|
85
|
+
// 这样冷色(紫/青)会变暖,暖色(橙/红)保持,过渡自然不突兀
|
|
86
|
+
const blend = 0.4;
|
|
87
|
+
r = Math.round(r + (0xff - r) * blend);
|
|
88
|
+
g = Math.round(g + (0x9f - g) * blend);
|
|
89
|
+
b = Math.round(b + (0x1c - b) * blend);
|
|
90
|
+
// 呼吸:周期 ~800ms,60fps
|
|
86
91
|
const t = 0.5 + 0.5 * Math.sin(performance.now() / 400);
|
|
87
92
|
const bright = 0.25 + 0.75 * t;
|
|
88
93
|
const glow = t * t * 0.35;
|