This commit is contained in:
JustAGenericUsername 2024-02-09 18:32:33 -05:00
parent 3f4b4a3868
commit 0876474457
1 changed files with 46 additions and 43 deletions

View File

@ -1,4 +1,6 @@
function pixelColorPick(pixel,customColor=null) {
window.addEventListener('load', function() {
console.log("attempted override")
pixelColorPick = function(pixel,customColor=null) {
var element = pixel.element;
var elementInfo = elements[element];
//if (elementInfo.behavior instanceof Array) {
@ -24,9 +26,9 @@ function pixelColorPick(pixel,customColor=null) {
}
// Randomly darken or lighten the RGB color
var coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * 15);
var r = rgb.r + coloroffset;
var g = rgb.g + coloroffset;
var b = rgb.b + coloroffset;
var r = rgb.r + 0;
var g = rgb.g + 0;
var b = rgb.b + 0;
// Make sure the color is within the RGB range
r = Math.max(0, Math.min(255, r));
g = Math.max(0, Math.min(255, g));
@ -42,3 +44,4 @@ function pixelColorPick(pixel,customColor=null) {
}*/
return color;
}
});