the
This commit is contained in:
parent
3f4b4a3868
commit
0876474457
|
|
@ -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 element = pixel.element;
|
||||||
var elementInfo = elements[element];
|
var elementInfo = elements[element];
|
||||||
//if (elementInfo.behavior instanceof Array) {
|
//if (elementInfo.behavior instanceof Array) {
|
||||||
|
|
@ -24,9 +26,9 @@ function pixelColorPick(pixel,customColor=null) {
|
||||||
}
|
}
|
||||||
// Randomly darken or lighten the RGB color
|
// Randomly darken or lighten the RGB color
|
||||||
var coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * 15);
|
var coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * 15);
|
||||||
var r = rgb.r + coloroffset;
|
var r = rgb.r + 0;
|
||||||
var g = rgb.g + coloroffset;
|
var g = rgb.g + 0;
|
||||||
var b = rgb.b + coloroffset;
|
var b = rgb.b + 0;
|
||||||
// Make sure the color is within the RGB range
|
// Make sure the color is within the RGB range
|
||||||
r = Math.max(0, Math.min(255, r));
|
r = Math.max(0, Math.min(255, r));
|
||||||
g = Math.max(0, Math.min(255, g));
|
g = Math.max(0, Math.min(255, g));
|
||||||
|
|
@ -41,4 +43,5 @@ function pixelColorPick(pixel,customColor=null) {
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue