import Color from "./color.js"; class Canvas { constructor() { this.element = document.createElement("canvas"); this.element.width = 1000; this.element.height = 1000; this._ctx = this.element.getContext("2d"); } setFillColor(color) { this._ctx.fillStyle = color.rgba(); } resetStyle() { this._ctx.fillStyle = ""; } draw(shape) { this._ctx.fillStyle = shape._color.rgba(); shape.draw(this._ctx); this.resetStyle(); } } export default Canvas;