// ==UserScript==
// u/namePurple Color Zone
// u/namespace Violentmonkey Scripts
// u/matchhttps://florr.io/*
// @grant unsafeWindow
// @version 1.0
// @author -
// @description 6/26/2020, 5:34:25 AM
// ==/UserScript==
const proxy = new Proxy(unsafeWindow.HTMLCanvasElement.prototype.getContext, {
apply(target, thisArg, args) {
const ctx = Reflect.apply(...arguments);
const prototype = Object.getPrototypeOf(ctx);
const descriptors = Object.getOwnPropertyDescriptors(prototype);
Object.defineProperties(prototype, {
fillStyle: {
get() {
// console.log("Getting fillStyle");
return descriptors.fillStyle.get.call(this);
},
set(value) {
// console.log(Setting fillStyle to ${value});
if (value == "#1EA761") value = "#c94dff"
if (value == "#DECF7C") value = "#a73bff"
if (value == "#B06655") value = "#b700ff"
if (value == "#4D5E56") value = "#6f00ff"
descriptors.fillStyle.set.call(this, value);
}
}
});
return ctx;
}
});
unsafeWindow.HTMLCanvasElement.prototype.getContext = proxy;