From 0844a7e827126e21132693b802924a69a9ce1b78 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:44:56 +0800 Subject: [PATCH] inverted paint --- mods/selective_paint.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/mods/selective_paint.js b/mods/selective_paint.js index 5cce2a37..822ff9bc 100644 --- a/mods/selective_paint.js +++ b/mods/selective_paint.js @@ -28,3 +28,33 @@ elements.selective_paint = { excludeRandom:true, desc: "Use on selected pixels to change their color." } +selectivePaintElem2 = "" +elements.exclusive_paint = { + color: ["#c27070","#c29c70","#c2c270","#70c270","#70c2c2","#7070c2","#c270c2"], + onSelect: function() { + var answer2 = prompt("Please input the desired element not to paint. It will not work if you enter multiple elements types while paused.",(selectivePaintElem2||undefined)); + if (!answer2) { return } + selectivePaintElem2 = mostSimilarElement(answer2); + }, + tool: function(pixel) { + if (pixel.element != selectivePaintElem2) { + if (!shiftDown) { + pixel.color = pixelColorPick(pixel,currentColor) + } + else { + // convert the hex of currentColor to rgb and set it as a string + var rgb = currentColor.replace("#","").match(/.{1,2}/g); + for (var i = 0; i < rgb.length; i++) { + rgb[i] = parseInt(rgb[i],16); + } + pixel.color = "rgb(" + rgb.join(",") + ")" + } + delete pixel.origColor; + } + }, + customColor: true, + category: "tools", + canPlace: false, + excludeRandom:true, + desc: "Used to paint pixels other than the one selected." +}