Refactor a thing

main
Isaiah Odhner 2020-06-02 23:35:55 -04:00
parent 84775b03d9
commit 2c1a30222c
1 changed files with 4 additions and 4 deletions

View File

@ -5,8 +5,8 @@ function $Swatch(color){
const swatch_canvas = make_canvas();
$(swatch_canvas).css({pointerEvents: "none"}).appendTo($b);
$b.update = _color => {
color = _color;
$b.update = (set_color_to = color) => {
color = set_color_to;
if(color instanceof CanvasPattern){
$b.addClass("pattern");
}else{
@ -25,9 +25,9 @@ function $Swatch(color){
});
};
$G.on("theme-load", () => {
$b.update(color);
$b.update();
});
$b.update(color);
$b.update();
return $b;
}