array imagecolorsforindex
指定したカラーインデックス index に対して適当な値からなる red、green、blue をキーとする連想配列を返します。
imagecoloratおよび imagecolorexactも参考にしてください。