Mirror Engine
V5
How To
Mirror Engine Logo

Mirror Engine API


Mirror Engine API / math / bytesToInt24

Function: bytesToInt24()

function bytesToInt24(r: number, g: number, b: number): number

Convert 3 8 bit Numbers into a single unsigned 24 bit Number.

Parameters

r

number

A single byte (0-255).

g

number

A single byte (0-255).

b

number

A single byte (0-255).

Returns

number

A single unsigned 24 bit Number.

Example

// Set result1 to 0x112233 from an array of 3 values
const result1 = math.bytesToInt24([
  0x11,
  0x22,
  0x33
])

// Set result2 to 0x112233 from 3 discrete values
const result2 = math.bytesToInt24(0x11, 0x22, 0x33)
Mirror Engine Logo