Not sure if it will help anyone, but I confused myself for a little bit but eventually figured it out.
If you would like to use this for custom names, to get the actual colors instead of it returning 0-255 (which won't help) you need to divide it by 255.
eg:
PHP Code:
temp.apcolors = shared.getAlignmentColor(player.ap);
//Gets the color in an array {red, green, blue}
temp.apcolors = {apcolors[0]/255, apcolors[1]/255, apcolors[2]/255};
//Divides the value by 255 to get the actual
//color needed and add it to an array.