UNPKG

lifehash

Version:

TypeScript/JavaScript implementation of LifeHash, a visual hash algorithm

18 lines (17 loc) 413 B
import { Colors } from './constants.js'; import { Grid } from './Grid.js'; export class ChangeGrid extends Grid { set_changed(point) { for (const pointp of this.get_neighborhood(point)) { this.set_value(true, pointp[1]); } } color_for_value(val) { if (val) { return Colors.red; } else { return Colors.blue; } } }