[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / world/mapColors

# world/mapColors

## Type Aliases

### Brightness

> **Brightness** = *typeof* [`Brightness`](#brightness-1)\[keyof *typeof* [`Brightness`](#brightness-1)\]

Defined in: [packages/prismarine/src/world/mapColors.ts:91](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/mapColors.ts#L91)

One [Brightness](#brightness-1).

***

### MapColorName

> **MapColorName** = keyof *typeof* `MAP_COLORS`

Defined in: [packages/prismarine/src/world/mapColors.ts:76](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/mapColors.ts#L76)

The name of one MAP\_COLORS entry.

## Variables

### Brightness

> `const` **Brightness**: `object`

Defined in: [packages/prismarine/src/world/mapColors.ts:91](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/mapColors.ts#L91)

`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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/mapColors.ts#L79)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/mapColors.ts#L117)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/mapColors.ts#L88)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/mapColors.ts#L109)

`MapColor.getPackedId`: the color id in the high six bits, the brightness in the low two.

#### Parameters

##### colorId

`number`

##### brightness

[`Brightness`](#brightness)

#### Returns

`number`
