fix shape highlight color
This commit is contained in:
parent
94850fbc9a
commit
611caf2621
|
|
@ -61,13 +61,13 @@ function invertPixels(ctx, width, height) {
|
||||||
for (let j = 0; j < patternSize; j++) {
|
for (let j = 0; j < patternSize; j++) {
|
||||||
const index = (i * patternSize + j) * 4;
|
const index = (i * patternSize + j) * 4;
|
||||||
// Determine if we should invert the color
|
// Determine if we should invert the color
|
||||||
if ((i + j) % 2 === 0) {
|
if ((i + j) % 2 === 0 || j%2===0) {
|
||||||
data[index] = 255; // Red
|
data[index] = 0; // Red
|
||||||
data[index + 1] = 0; // Green
|
data[index + 1] = 0; // Green
|
||||||
data[index + 2] = 0; // Blue
|
data[index + 2] = 0; // Blue
|
||||||
data[index + 3] = 255; // Alpha
|
data[index + 3] = 255; // Alpha
|
||||||
} else {
|
} else {
|
||||||
data[index] = 0; // Red (inverted)
|
data[index] = 255; // Red (inverted)
|
||||||
data[index + 1] = 255; // Green (inverted)
|
data[index + 1] = 255; // Green (inverted)
|
||||||
data[index + 2] = 255; // Blue (inverted)
|
data[index + 2] = 255; // Blue (inverted)
|
||||||
data[index + 3] = 255; // Alpha
|
data[index + 3] = 255; // Alpha
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue