From 1eeaec3ad469faa2596fc1dfcb2ff521546e2593 Mon Sep 17 00:00:00 2001 From: MiraclePatrickLumowa Date: Mon, 18 Aug 2025 19:43:41 +0800 Subject: [PATCH] Update Auto-Image.js --- Auto-Image.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Auto-Image.js b/Auto-Image.js index 122c224..7eb031c 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -211,7 +211,7 @@ // BILINGUAL TEXT STRINGS const TEXT = { en: { - title: "WPlace Auto-drawing", + title: "WPlace Auto-Image", toggleOverlay: "Toggle Overlay", scanColors: "Scan Colors", uploadImage: "Upload Image", @@ -1272,9 +1272,14 @@ window.addEventListener('message', (event) => { totalCount++; // Check if this color is available in the captured colors - const isAvailable = state.availableColors.some(c => - c.rgb[0] === rgb.r && c.rgb[1] === rgb.g && c.rgb[2] === rgb.b - ); + // First try to match by ID, then fall back to RGB matching + const isAvailable = state.availableColors.some(c => { + // Primary match: by ID + if (c.id === id) return true; + + // Fallback match: by RGB (for cases where IDs don't align) + return c.rgb[0] === rgb.r && c.rgb[1] === rgb.g && c.rgb[2] === rgb.b; + }); // Debug: Log a few color comparisons if (id <= 5) {