Static
ofThe main method of this class, used to get a mapped color for a given color on the canvas snapshot.
Readonly
typeA property helpful for TypeScript type inference, when distinguishing from other types of colors.
const c:
| null
| BpxRgbColor
| BpxPatternColors
| BpxSpriteColorMapping
| BpxCanvasSnapshotColorMapping
= getColor();
if (c == null) {
// c is transparent here
} else if (c.type === "rgb") {
// c is BpxRgbColor here
} else if (c.type === "pattern") {
// c is BpxPatternColors here
} else if (c.type === "sprite_mapping") {
// c is BpxSpriteColorMapping here
} else if (c.type === "canvas_snapshot_mapping") {
// c is BpxCanvasSnapshotColorMapping here
} else {
$u.assertUnreachable(c);
}
See