StaticfromStaticofChecks if this color has same red, green, and blue components as the other one.
ReadonlybA blue component, an integer between 0 and 255.
ReadonlycssA hex representation of this color. Can be used e.g. for CSS. Or just for simple way to store a color as a single value.
ReadonlygA green component, an integer between 0 and 255.
ReadonlyrA red component, an integer between 0 and 255.
ReadonlytypeA 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);
}
A representation of a RGB, fully opaque color