Question: plot3d color function

I want to interpolate two colors

CI := proc(r)
   local X, Y;
   X := [0, 100/255, 0];  Y := [1,1,1];   
   #return r*X+(1-r)*Y
   return [r*X[1]+(1-r)*Y[1], r*X[2]+(1-r)*Y[2], r*X[3]+(1-r)*Y[3]]
end proc: 

plot3d(0, x=0..1, y=0..1, style=surface, axes=boxed, orientation=[-90,0], color=CI(x));

works. However the first version with return r*X+(1-r)*Y fails. Why? Both give the same result for CI(0.9) and true for type(CI(0.9),list).



Please Wait...