@@ -350,9 +350,7 @@ export class Stacking3DRenderer extends RendererBase {
350350
351351 let colour = this . options . colourContext . annotations ;
352352 if ( ( "colour" in note ) && ( note . colour !== undefined ) ) {
353- colour = note . colour as string ;
354- } else if ( ( "player" in note ) && ( note . player !== undefined ) ) {
355- colour = this . options . colours [ ( note . player as number ) - 1 ] ;
353+ colour = this . resolveColour ( note . colour , this . options . colourContext . annotations ) as string ;
356354 }
357355 let style = "solid" ;
358356 if ( ( "style" in note ) && ( note . style !== undefined ) ) {
@@ -397,9 +395,7 @@ export class Stacking3DRenderer extends RendererBase {
397395
398396 let colour = this . options . colourContext . annotations ;
399397 if ( ( "colour" in note ) && ( note . colour !== undefined ) ) {
400- colour = note . colour as string ;
401- } else if ( ( "player" in note ) && ( note . player !== undefined ) ) {
402- colour = this . options . colours [ ( note . player as number ) - 1 ] ;
398+ colour = this . resolveColour ( note . colour , this . options . colourContext . annotations ) as string ;
403399 }
404400 let style = "dashed" ;
405401 if ( ( "style" in note ) && ( note . style !== undefined ) ) {
@@ -450,9 +446,7 @@ export class Stacking3DRenderer extends RendererBase {
450446 } else if ( ( note . type !== undefined ) && ( note . type === "enter" ) ) {
451447 let colour = this . options . colourContext . annotations ;
452448 if ( ( "colour" in note ) && ( note . colour !== undefined ) ) {
453- colour = note . colour as string ;
454- } else if ( ( "player" in note ) && ( note . player !== undefined ) ) {
455- colour = this . options . colours [ ( note . player as number ) - 1 ] ;
449+ colour = this . resolveColour ( note . colour , this . options . colourContext . annotations ) as string ;
456450 }
457451 for ( const node of ( note . targets as ITarget [ ] ) ) {
458452 const center = grid [ node . row ] [ node . col ] ;
@@ -476,9 +470,7 @@ export class Stacking3DRenderer extends RendererBase {
476470 } else if ( ( note . type !== undefined ) && ( note . type === "exit" ) ) {
477471 let colour = this . options . colourContext . annotations ;
478472 if ( ( "colour" in note ) && ( note . colour !== undefined ) ) {
479- colour = note . colour as string ;
480- } else if ( ( "player" in note ) && ( note . player !== undefined ) ) {
481- colour = this . options . colours [ ( note . player as number ) - 1 ] ;
473+ colour = this . resolveColour ( note . colour , this . options . colourContext . annotations ) as string ;
482474 }
483475 for ( const node of ( note . targets as ITarget [ ] ) ) {
484476 const center = grid [ node . row ] [ node . col ] ;
@@ -502,9 +494,7 @@ export class Stacking3DRenderer extends RendererBase {
502494 } else if ( ( note . type !== undefined ) && ( note . type === "dots" ) ) {
503495 let colour = this . options . colourContext . annotations ;
504496 if ( ( "colour" in note ) && ( note . colour !== undefined ) ) {
505- colour = note . colour as string ;
506- } else if ( ( "player" in note ) && ( note . player !== undefined ) ) {
507- colour = this . options . colours [ ( note . player as number ) - 1 ] ;
497+ colour = this . resolveColour ( note . colour , this . options . colourContext . annotations ) as string ;
508498 }
509499 let opacity = 1 ;
510500 if ( ( "opacity" in note ) && ( note . opacity !== undefined ) ) {
0 commit comments