a bad idea caused problems: no more Cell.getColor()

This commit is contained in:
Gavin McDonald
2018-09-15 00:03:36 -04:00
parent d5862b2c97
commit 2c671c2f99
4 changed files with 10 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
import {FLAT, POINTY} from './consts.js';
import {range, toFixed} from './utils.js';
import {getColor, range, toFixed} from './utils.js';
export default class DrawHexagon {
constructor(settings) {
@@ -46,7 +46,7 @@ export default class DrawHexagon {
context.closePath();
context.lineWidth = cell.width;
context.strokeStyle = cell.getColor();
context.strokeStyle = getColor(cell.color);
context.stroke();
}
@@ -63,7 +63,7 @@ export default class DrawHexagon {
context.lineTo(x + scale * hexCornerX[4], y + scale * hexCornerY[4]);
context.lineTo(x + scale * hexCornerX[5], y + scale * hexCornerY[5]);
context.fillStyle = cell.getColor();
context.fillStyle = getColor(cell.color);
context.fill();
}
}