summaryrefslogtreecommitdiff
path: root/color/colormap.py
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-09-19 14:36:13 -0400
committerStan Seibert <stan@mtrr.org>2011-09-19 14:36:13 -0400
commita21b05e4727403e2e061234289af9e60e6022e5a (patch)
tree7a7d4c5809c370f3e542cfc8cb0bec7c2e4f5cdc /color/colormap.py
parentcfecff941fc619eb7269128afc62d9c11ae78aff (diff)
parenta38c56ff1e268298568077af7f03c8ac64c6fb82 (diff)
downloadchroma-a21b05e4727403e2e061234289af9e60e6022e5a.tar.gz
chroma-a21b05e4727403e2e061234289af9e60e6022e5a.tar.bz2
chroma-a21b05e4727403e2e061234289af9e60e6022e5a.zip
merge relayout branch
Diffstat (limited to 'color/colormap.py')
-rw-r--r--color/colormap.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/color/colormap.py b/color/colormap.py
deleted file mode 100644
index 6f3e056..0000000
--- a/color/colormap.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import numpy as np
-import matplotlib.cm as cm
-
-def map_to_color(a, range=None, map=cm.hsv, weights=None):
- a = np.asarray(a)
- if range is None:
- range = (a.min(), a.max())
-
- ax = (a - range[0])/(range[1]-range[0])
-
- frgba = map(ax)
-
- if weights is not None:
- frgba[:,0] *= weights
- frgba[:,1] *= weights
- frgba[:,2] *= weights
-
- rgba = (frgba*255).astype(np.uint32)
-
- return rgba[:,0] << 16 | rgba[:,1] << 8 | rgba[:,2]