Category: 2D Overlay
Syntax:
b2dGetImagePaletteColorR:Int(imageHandle:Int, index:Int)
Int
Returns the red component of a palette entry, 0 to 255.
Takes imageHandle and index (0 to 255).
Returns the red value, or 0 if the handle or index is invalid.
This reads the stored palette, not the animated one - it returns the entry as loaded or as last set by b2dSetImagePaletteColor, and is unaffected by any cycling or fading currently running.
View detailed documentation online
; 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