colormap.py
Go to the documentation of this file.
00001 def colormap1(data):
00002     data = data * 6000
00003     if data < 1000:
00004         return (0,0,0)
00005     if data < 3000:
00006         x = (data-1000)/2000.
00007         return 0,0,x
00008     if data < 6000:
00009         x = (data-3000)/3000.
00010         return x,0,(1-x)
00011     if data < 10000:
00012         x = (data-6000)/4000.
00013         return 1.0,x,x
00014     return 1.0,1.0,1.0
00015 
00016 def colormap2(data):
00017     if data < -1:
00018         return 0,0,1
00019     if data < 0:
00020         x = data+1
00021         return 0,0,1*(1-x)
00022     if data < 1:
00023         x = data
00024         return 1*x,0,0
00025     if data < 3:
00026         x = data-1
00027         return 1,1*x,1*x
00028     return 1,1,1
00029 
00030 color = colormap2
00031 
00032 def color255(data):
00033     (r,g,b) = color(data)
00034     return (255 * r, 255 * g, 255 * b)


fingertip_pressure
Author(s): Blaise Gassend
autogenerated on Fri Aug 28 2015 12:09:42