From 79f2108a8601157a716641864c4f3435ac33a6d5 Mon Sep 17 00:00:00 2001 From: SSlime-s <62363188+SSlime-s@users.noreply.github.com> Date: Fri, 17 May 2024 19:15:39 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20colorCode=20=E3=82=92?= =?UTF-8?q?=E6=98=8E=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/client/app/features/artboard/bucketFill.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/client/app/features/artboard/bucketFill.ts b/apps/client/app/features/artboard/bucketFill.ts index 0d10481..ec9019c 100644 --- a/apps/client/app/features/artboard/bucketFill.ts +++ b/apps/client/app/features/artboard/bucketFill.ts @@ -87,7 +87,7 @@ export function bucketFill( canvas: HTMLCanvasElement, x: number, y: number, - color: `#${string}`, + colorCode: `#${string}`, widthRange?: [number, number], heightRange?: [number, number], likeEqualColor: LikeEqualColor = equalColor, @@ -103,12 +103,12 @@ export function bucketFill( const data = imageData.data; const formattedData = rawToColors(data, width, height); const targetColor = formattedData[y][x]; - const colorObj = hexToColor(color); - if (colorObj === null) { + const color = hexToColor(colorCode); + if (color === null) { console.error("invalid color"); return; } - if (likeEqualColor(colorObj, targetColor)) return; + if (likeEqualColor(color, targetColor)) return; const xRange = widthRange ?? [0, width]; const yRange = heightRange ?? [0, height]; @@ -124,7 +124,7 @@ export function bucketFill( formattedData, x, y, - colorObj, + color, xRange, targetColor, likeEqualColor, @@ -134,7 +134,7 @@ export function bucketFill( formattedData, x, y, - colorObj, + color, xRange, targetColor, likeEqualColor,