MCPcopy Create free account
hub / github.com/code100x/plinkoo / getColor

Method getColor

frontend/src/game/classes/BallManager.ts:43–60  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

41 }
42
43 getColor(index: number) {
44 if (index <3 || index > this.sinks.length - 3) {
45 return {background: '#ff003f', color: 'white'};
46 }
47 if (index < 6 || index > this.sinks.length - 6) {
48 return {background: '#ff7f00', color: 'white'};
49 }
50 if (index < 9 || index > this.sinks.length - 9) {
51 return {background: '#ffbf00', color: 'black'};
52 }
53 if (index < 12 || index > this.sinks.length - 12) {
54 return {background: '#ffff00', color: 'black'};
55 }
56 if (index < 15 || index > this.sinks.length - 15) {
57 return {background: '#bfff00', color: 'black'};
58 }
59 return {background: '#7fff00', color: 'black'};
60 }
61 drawSinks() {
62 this.ctx.fillStyle = 'green';
63 const SPACING = obstacleRadius * 2;

Callers 1

drawSinksMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected