[READ-ONLY] Mirror of https://github.com/bombshell-dev/tty. Platform independent 2D layout engine for terminal applications based on Clay
5

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ› accept signed int32 colors in validator

The rgba() function returns signed int32 when alpha >= 128 (bit 31
set). The validator's u32 type rejected these negative values. Add
a color type that accepts the full signed-to-unsigned 32-bit range.

Charles Lowell (Apr 8, 2026, 4:45 PM -0500) 92577d48 76027226

+8 -5
+8 -5
validate.ts
··· 7 7 8 8 const u8 = Type.Integer({ minimum: 0, maximum: 255 }); 9 9 const u16 = Type.Integer({ minimum: 0, maximum: 65535 }); 10 - const u32 = Type.Integer({ minimum: 0, maximum: 0xFFFFFFFF }); 11 - const color = Type.Integer({ minimum: -0x80000000, maximum: 0xFFFFFFFF }); 10 + 11 + /* RGBA color packed as (a << 24 | r << 16 | g << 8 | b). When alpha >= 128, 12 + * bit 31 is set and JavaScript interprets the value as a negative int32. 13 + * Accept both signed and unsigned representations of the same bit pattern. */ 14 + const rgba = Type.Integer({ minimum: -0x80000000, maximum: 0xFFFFFFFF }); 12 15 13 16 /* โ”€โ”€ Sizing axis (discriminated union) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ 14 17 ··· 65 68 }); 66 69 67 70 const Border = Type.Object({ 68 - color: color, 71 + color: rgba, 69 72 left: Type.Optional(u8), 70 73 right: Type.Optional(u8), 71 74 top: Type.Optional(u8), ··· 94 97 id: Type.Literal(0x02), 95 98 name: Type.String(), 96 99 layout: Type.Optional(Layout), 97 - bg: Type.Optional(color), 100 + bg: Type.Optional(rgba), 98 101 cornerRadius: Type.Optional(CornerRadius), 99 102 border: Type.Optional(Border), 100 103 clip: Type.Optional(Clip), ··· 104 107 const TextOp = Type.Object({ 105 108 id: Type.Literal(0x03), 106 109 content: Type.String(), 107 - color: Type.Optional(color), 110 + color: Type.Optional(rgba), 108 111 fontSize: Type.Optional(u8), 109 112 fontId: Type.Optional(u8), 110 113 wrap: Type.Optional(u8),