{"size": 944, "ext": "js", "max_stars_repo_path": "src/components/LifeCanvas/Cell.js", "max_stars_repo_name": "Skidragon/skidragon.github.io-demo-conway", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/LifeCanvas/Cell.js", "max_issues_repo_name": "Skidragon/skidragon.github.io-demo-conway", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/LifeCanvas/Cell.js", "max_forks_repo_name": "Skidragon/skidragon.github.io-demo-conway", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.4545454545, "max_line_length": 48, "alphanum_fraction": 0.468220339}
const white = "rgb(255,255,255)";
const black = "rgb(0,0,0)";
function parseRGBValues() {

}
class Cell {
    constructor(ctx, length) {
        this.ctx = ctx;
        this.length = length;
        this.color = white;
        this.isToggled = false;
        this.x = 0;
        this.y = 0;
    }
    setCoords(x, y) {
        this.x = x;
        this.y = y;
    }
    draw(x, y) {
        this.ctx.beginPath();
        this.ctx.fillStyle = this.color;
        this.ctx.rect(
            this.x,
            this.y,
            this.length,
            this.length
          );
        this.ctx.fill();
        this.ctx.stroke();
    }
    switchColors() {
        console.log(this.isToggled, this.color);
        if(this.isToggled === false) {
            this.color = black;
            this.isToggled = true;
        }
        else {
            this.color = white;
            this.isToggled = false;
        }
    }
}

export default Cell;