Skip to content
Image & Canvas indexedToHex

$indexedToHex — Converts palette indexes to hex colors (JSON array).

Converts palette indexes to hex colors (JSON array).

Syntax

$indexedToHex[palette;(transparent);(alwaysAlpha);(allowShort);pixels]

Parameters

  • palette (Json, required) — Red, green, blue values of the palette
  • transparent (Number, optional) — Index of the transparent color
  • alwaysAlpha (Boolean, optional) — Always add the alpha channel
  • allowShort (Boolean, optional) — Allow the short form
  • pixels (Number, required) — Indexes (0 to 255)

Return Value

  • Json.

Usage

$indexedToHex[palette;transparent;alwaysAlpha;allowShort;pixels] → result

Example

$sendMessage[$indexedToHex[palette;transparent;alwaysAlpha;allowShort;pixels]]

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.