@brimveyn/aimux-config 0.5.7 → 0.5.8

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": "@brimveyn/aimux-config",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "TypeScript configuration API for aimux — keymaps, themes, and backends with a fluent builder.",
5
5
  "keywords": [
6
6
  "aimux",
@@ -102,15 +102,14 @@ function resolveColorRgba(
102
102
  }
103
103
 
104
104
  function rgbaToCss(c: RGBA): string {
105
- const r = Math.max(0, Math.min(255, Math.round(c.r)))
106
- const g = Math.max(0, Math.min(255, Math.round(c.g)))
107
- const b = Math.max(0, Math.min(255, Math.round(c.b)))
108
- const a = Math.max(0, Math.min(255, Math.round(c.a)))
109
- if (a === 255) {
110
- const hex = (v: number) => v.toString(16).padStart(2, '0')
111
- return `#${hex(r)}${hex(g)}${hex(b)}`
112
- }
113
- return `rgba(${r}, ${g}, ${b}, ${(a / 255).toFixed(3)})`
105
+ const clamp = (v: number) => Math.max(0, Math.min(255, Math.round(v)))
106
+ const hex = (v: number) => clamp(v).toString(16).padStart(2, '0')
107
+ const r = hex(c.r)
108
+ const g = hex(c.g)
109
+ const b = hex(c.b)
110
+ // opentui only parses hex strings (#rrggbb / #rrggbbaa) `rgba(...)` falls
111
+ // back to magenta. Always emit hex; append alpha byte when not fully opaque.
112
+ return clamp(c.a) === 255 ? `#${r}${g}${b}` : `#${r}${g}${b}${hex(c.a)}`
114
113
  }
115
114
 
116
115
  /**