Mine Upgrade (#15)

This commit is contained in:
gavin
2018-08-24 02:42:33 +00:00
committed by Gitea
parent 90cf1723a8
commit a2d7402cfa
5 changed files with 171 additions and 108 deletions

View File

@@ -1,4 +1,4 @@
import {random} from './utils.js';
import {getColor, random} from './utils.js';
import {
HEX, CIRCLE, SQUARE,
FLAT, POINTY,
@@ -15,10 +15,12 @@ const DEFAULTS = {
drawStyle: FILL,
width: 1,
red: 0,
green: 0,
blue: 0,
alpha: 0.5,
color: {
red: 0,
green: 0,
blue: 0,
alpha: 0.5,
},
};
export default class Cell {
@@ -29,7 +31,7 @@ export default class Cell {
}
getColor() {
return `rgba(${this.red},${this.green},${this.blue},${this.alpha})`;
return getColor(this.color);
}
}