c
if (t >= 0 && t < cmaplen) {
    *outptr++ = colormap[0][t];
} else {
    // Handle error: index out of bounds
}
