You can reference colors in the palette by name or number in most commands that understand color names.
You can programmatically access the colors using ColorTools commands
The index 0 doesn't work, but the string xterm 0 is valid
The colors are organized into three sets: 0-15 are the system colors supported by the older systems, 16-231 are 6x6x6 cube of 16-bit colors, and 232-255 are 24 evenly spaced shades of gray.