This commit is contained in:
Andras Schmelczer 2019-09-16 15:18:23 +02:00
commit 674f07f5f1

View file

@ -48,8 +48,8 @@ export class Tower extends Serializable implements ITower, TowerState {
this.changeKeys({ name });
}
getColorOfBlock(block: Block): IColor {
return lighten((hash(block.tag) - 0.5) * 50, this.baseColor);
getColorOfTag(tag: string): IColor {
return lighten((hash(tag) - 0.5) * 50, this.baseColor);
}
protected onAfterClone() {
@ -59,7 +59,7 @@ export class Tower extends Serializable implements ITower, TowerState {
this.coloredBlocks = this.blocks.map(b => {
const coloredBlock = b as ColoredBlock;
coloredBlock.color = this.getColorOfBlock(b);
coloredBlock.color = this.getColorOfTag(b.tag);
return coloredBlock;
});