# How to color a BSplineSurface

I am trying to color a BSplineSurface in a complex way but not having any luck using ColorFunction. I can use ColorFunction if I using BSplineFunction and ParametricPlot3D but would prefer not to go that route. Here is an example of the surface I would like to color:

Graphics3D[{EdgeForm[], SeedRandom[4];
BSplineSurface[Table[{x, y, 0.25 + UnitStep[30 - Abs[x] - 0.001] UnitStep[50 -Abs[y] - 0.001] (0.25/RandomReal[{0.1, 2}]^2)},
{x, -30, 30, 5.}, {y, -50, 50, 5.}]]}, Boxed -> False]


I would like to be able to color the peaks with one color (red) and have that color fade away to gray in the flat parts.

-
I think that you cannot, as it's a single graphics object. But you can construct a BSplineFunction, use Plot3D to plot it, and use ColorFunction in Plot3D. This'll build up the plot from many graphics objects (polygons), each of which will be separately coloured based on your ColorFunction –  Szabolcs Jul 1 '14 at 17:49
Are you the same person as here? –  Szabolcs Jul 1 '14 at 17:50
Yes. I was not able to log-in to the account for some reason. –  BeauGeste Jul 1 '14 at 18:17
It's better to prepend your comment with @szabolcs if you want him to get a notification –  belisarius Jul 1 '14 at 18:44

SeedRandom[4];