Skip to content

API reference / @jsprismarine/prismarine / world/mapColors

world/mapColors ​

Type Aliases ​

Brightness ​

Brightness = typeof Brightness[keyof typeof Brightness]

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 ​

const Brightness: 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 ​

readonly HIGH: object

HIGH.id ​

readonly id: 2 = 2

HIGH.modifier ​

readonly modifier: 255 = 255

LOW ​

readonly LOW: object

LOW.id ​

readonly id: 0 = 0

LOW.modifier ​

readonly modifier: 180 = 180

LOWEST ​

readonly LOWEST: object

LOWEST.id ​

readonly id: 3 = 3

LOWEST.modifier ​

readonly modifier: 135 = 135

NORMAL ​

readonly NORMAL: object

NORMAL.id ​

readonly id: 1 = 1

NORMAL.modifier ​

readonly modifier: 220 = 220


MapColors ​

const MapColors: { 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 ​

Brightness

Returns ​

number