#=======================================================================
# Black to white color map (going from dark to light, in going from
# color index 16 to 239).
#
# Copyright (c) 2003 by Johnny Lin.  For licensing, distribution
# conditions, contact information, and additional documentation see
# the URL http://www.johnny-lin.com/pylib.html#license.
#=======================================================================


#- Import modules and open VCS canvas:

import vcs
v = vcs.init()


#- Copy the default color map to create my own color map "my_cmap":

my_cmap = v.createcolormap('my_cmap', 'default')


#- Compute RGB values and fill the my_cmap.index dictionary for
#  color indices 16 to 239:

for icell in range(16,240):
    rvalue = int( float(icell-16)/(239.-16.) * 100. )
    gvalue = rvalue
    bvalue = rvalue
    my_cmap.index[icell] = [rvalue, gvalue, bvalue]


#- Set my color map to the active color map:

v.setcolormap('my_cmap')




#====== end of file ======
