Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

fix: handle ink(color, alphaOverride) pattern in API wrapper

+14 -1
+14 -1
oven/kidlisp-mini/bundle.mjs
··· 164 164 const api = { 165 165 screen: { width: W, height: H }, 166 166 wipe: (r, g, b, a = 255) => renderer.wipe(r, g, b, a), 167 - ink: (r, g, b, a = 255) => renderer.setColor(r, g, b, a), 167 + ink: (...args) => { 168 + // Handle different ink argument patterns like real KidLisp 169 + // ink([r,g,b,a], alphaOverride) → setColor(r,g,b,alphaOverride) 170 + if (args.length === 2 && Array.isArray(args[0])) { 171 + const [color, alphaOverride] = args; 172 + renderer.setColor(color[0], color[1], color[2], alphaOverride); 173 + } else if (args.length === 1 && Array.isArray(args[0])) { 174 + const [r, g, b, a] = args[0]; 175 + renderer.setColor(r, g, b, a); 176 + } else { 177 + const [r, g, b, a = 255] = args; 178 + renderer.setColor(r, g, b, a); 179 + } 180 + }, 168 181 line: (x0, y0, x1, y1) => renderer.line(x0, y0, x1, y1), 169 182 box: (x, y, w, h, mode = 'fill') => renderer.box(x, y, w, h, mode), 170 183 circle: (cx, cy, r, mode = 'fill') => renderer.circle(cx, cy, r, mode),