Skip to content
docs
GitHub 4M /week v2.2.1
Type reference

intToRGBA

intToRGBA(i): RGBAColor

Defined in: packages/utils/dist/esm/index.d.ts:60

A helper method that converts RGBA values to a single integer value

Parameters

i

number

A single integer value representing an RGBA colour (e.g. 0xFF0000FF for red)

Returns

RGBAColor

An object with the properties r, g, b and a representing RGBA values

Example

import { intToRGBA } from "@jimp/utils";
intToRGBA(0xFF0000FF); // { r: 255, g: 0, b: 0, a:255 }
Jimp v2.2.1