b2dSetImagePaletteColor

Category: 2D Overlay

Syntax:

b2dSetImagePaletteColor:Void(imageHandle:Int, index:Int, r:Int, g:Int, b:Int, a:Int)


Parameters

Returns

Void



Summary

Sets one palette entry.

Takes imageHandle, index (0 to 255) and r, g, b, a (each 0 to 255, clamped).

Returns nothing.

Colour changes are made to the image's own stored palette, so they survive cycling and fading rather than being overwritten by the next frame. A palette has 256 entries, numbered 0 to 255. An out-of-range index or an unknown image handle is ignored.

b2dResetPalette undoes every change made this way.

View detailed documentation online



Example
; Make palette entry 5 pure red, then read it back.
b2dSetImagePaletteColor(img, 5, 255, 0, 0, 255)
Print ToString(b2dGetImagePaletteColorR(img, 5))    ; 255

BambooBasic © 2026 Michael Denathorn