API reference / @jsprismarine/prismarine / world/mapColors
world/mapColors
Type Aliases
Brightness
Brightness = typeof
Brightness[keyof typeofBrightness]
Defined in: packages/prismarine/src/world/mapColors.ts:91
One Brightness.
MapColorName
MapColorName = keyof typeof
MAP_COLORS
Defined in: packages/prismarine/src/world/mapColors.ts:76
The name of one MAP_COLORS entry.
Variables
Brightness
constBrightness:object
Defined in: packages/prismarine/src/world/mapColors.ts:91
MapColor$Brightness, by the id Java packs beside the color and the multiplier it applies.
Type Declaration
HIGH
readonlyHIGH:object
HIGH.id
readonlyid:2=2
HIGH.modifier
readonlymodifier:255=255
LOW
readonlyLOW:object
LOW.id
readonlyid:0=0
LOW.modifier
readonlymodifier:180=180
LOWEST
readonlyLOWEST:object
LOWEST.id
readonlyid:3=3
LOWEST.modifier
readonlymodifier:135=135
NORMAL
readonlyNORMAL:object
NORMAL.id
readonlyid:1=1
NORMAL.modifier
readonlymodifier:220=220
MapColors
constMapColors:{ readonly [Name in MapColorName]: { id: number; rgb: number } }=MAP_COLORS
Defined in: packages/prismarine/src/world/mapColors.ts:79
The colors a map is drawn with by name, as { id, rgb }.
Functions
bedrockPixelOf()
bedrockPixelOf(
packedId):number
Defined in: packages/prismarine/src/world/mapColors.ts:117
One packed Java map color as a Bedrock pixel: MapColor.calculateARGBColor with the channels in the order a Bedrock client reads them, red in the low byte and alpha in the high one. none, which Java draws as 0, is fully transparent, which the client draws as bare parchment.
Parameters
packedId
number
Returns
number
mapColorIdOf()
mapColorIdOf(
name):number
Defined in: packages/prismarine/src/world/mapColors.ts:88
The id of a color named the way @jsprismarine/mapping names it, or none's for an unknown name.
Parameters
name
string
Returns
number
packedMapColor()
packedMapColor(
colorId,brightness):number
Defined in: packages/prismarine/src/world/mapColors.ts:109
MapColor.getPackedId: the color id in the high six bits, the brightness in the low two.
Parameters
colorId
number
brightness
Returns
number