colormap.py
Go to the documentation of this file.
1 def colormap1(data):
2  data = data * 6000
3  if data < 1000:
4  return (0,0,0)
5  if data < 3000:
6  x = (data-1000)/2000.
7  return 0,0,x
8  if data < 6000:
9  x = (data-3000)/3000.
10  return x,0,(1-x)
11  if data < 10000:
12  x = (data-6000)/4000.
13  return 1.0,x,x
14  return 1.0,1.0,1.0
15 
16 def colormap2(data):
17  if data < -1:
18  return 0,0,1
19  if data < 0:
20  x = data+1
21  return 0,0,1*(1-x)
22  if data < 1:
23  x = data
24  return 1*x,0,0
25  if data < 3:
26  x = data-1
27  return 1,1*x,1*x
28  return 1,1,1
29 
30 color = colormap2
31 
32 def color255(data):
33  (r,g,b) = color(data)
34  return (255 * r, 255 * g, 255 * b)


fingertip_pressure
Author(s): Blaise Gassend
autogenerated on Fri Mar 15 2019 02:53:38