やりたいことはpinterがNULLも可で、
if (color)
 pointer[n++] = pointer ? color : 代入を無かったことに;

pointerがNULLでない時だけ代入したいのですが、これが難しい。