Mine Upgrade (#15)
This commit is contained in:
14
src/cell.js
14
src/cell.js
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user