Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

fix: remove magenta error fallbacks and guard stale color strings in renderer

Replace magenta (255,0,255) error colors with black/transparent fallbacks
in findColor and plot. Add guards in box, lineh, and lineFast to reset
stale non-numeric color strings before drawing — prevents intermittent
magenta artifacts when mask + zebra ink state leaks across frames.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+19 -5
+19 -5
system/public/aesthetic.computer/lib/graph.mjs
··· 1067 1067 args = hexToRgb(cleanedHex); 1068 1068 } else if (args[0].startsWith("fade:")) { 1069 1069 // Fade operations should have been handled above - this is a fallback 1070 - args = [255, 0, 255]; // Fallback to magenta to indicate error 1070 + args = [0, 0, 0]; // Fallback to black (stale fade string) 1071 1071 args.push(255); 1072 1072 } else { 1073 1073 // Try CSS color table lookup ··· 1653 1653 const resolvedColor = getLocalFadeColor(null, x, y, fadeInfo); 1654 1654 plotColor = [...resolvedColor, c[1] || 255]; // Use fade alpha 1655 1655 } else { 1656 - // Fallback to solid color if fade parsing fails 1657 - plotColor = [255, 0, 255, alpha]; // Magenta to indicate error 1656 + // Fallback to transparent if fade parsing fails (stale fade string) 1657 + plotColor = [0, 0, 0, 0]; 1658 1658 } 1659 1659 } 1660 1660 ··· 2768 2768 // Used when no fade, no gradient, no skip list - just pure pixel writing 2769 2769 function lineFast(x0, y0, x1, y1) { 2770 2770 if (!pixels) return; 2771 - 2771 + // Guard: resolve stale non-numeric color to prevent artifacts 2772 + if (typeof c[0] === 'string' && !c[0].startsWith('fade:')) { 2773 + setColor(0, 0, 0, c[3] || 255); 2774 + } 2775 + 2772 2776 // Floor coordinates 2773 2777 x0 = floor(x0) || 0; 2774 2778 y0 = floor(y0) || 0; ··· 2844 2848 x1 = floor(x1); 2845 2849 y = floor(y); 2846 2850 if (!pixels) return; 2851 + // Guard: resolve stale non-numeric color to prevent artifacts 2852 + if (typeof c[0] === 'string' && !c[0].startsWith('fade:')) { 2853 + setColor(0, 0, 0, c[3] || 255); 2854 + } 2847 2855 if (y < 0 || y >= height || x0 >= width || x1 < 0) return; // Check if the entire line is outside the mask 2848 2856 if (activeMask) { 2849 2857 // Don't apply pan translation to mask bounds - mask is already set at current pan position ··· 3675 3683 } else if (mode === "fill" || mode === "") { 3676 3684 // TODO: The boxes could be cropped to always fit inside the screen here. 3677 3685 w -= 1; 3686 + 3687 + // Guard: resolve stale fade strings in c to prevent rendering artifacts 3688 + if (typeof c[0] === 'string' && !c[0].startsWith('fade:')) { 3689 + setColor(0, 0, 0, c[3] || 255); 3690 + } 3691 + 3678 3692 const cachedInk = c.slice(0); 3679 - 3693 + 3680 3694 // 🎨 NEW LOCAL FADE HANDLING: Check if current color is a fade 3681 3695 const fadeInfo = parseFadeColor(c); 3682 3696 const isLocalFade = fadeInfo !== null;