()
| 280 | } |
| 281 | |
| 282 | handleAddAgentByClick() { |
| 283 | const color = randomColor({ luminosity: "light", alpha: 0.5 }); |
| 284 | while (this.state.usedColors.has(color)) { |
| 285 | color = randomColor({ luminosity: "light" }); |
| 286 | } |
| 287 | this.setState({ usedColors: this.state.usedColors.add(color) }); |
| 288 | this.setState({ startToAdd: true, colorToAdd: color }); |
| 289 | } |
| 290 | |
| 291 | addAgent(color) { |
| 292 | this.setState({ |