Skip to content
Snippets Groups Projects
Commit d0c45ed7 authored by s233039's avatar s233039 Committed by fima
Browse files

QIM themed colormap

parent 6a7b6799
No related branches found
No related tags found
1 merge request!74QIM themed colormap
docs/assets/screenshots/viz-colormaps-qim.png

769 B

...@@ -17,3 +17,4 @@ The `qim3d` library aims to provide easy ways to explore and get insights from v ...@@ -17,3 +17,4 @@ The `qim3d` library aims to provide easy ways to explore and get insights from v
options: options:
members: members:
- objects - objects
- qim
...@@ -6,6 +6,7 @@ import colorsys ...@@ -6,6 +6,7 @@ import colorsys
from typing import Union, Tuple from typing import Union, Tuple
import numpy as np import numpy as np
from matplotlib.colors import LinearSegmentedColormap from matplotlib.colors import LinearSegmentedColormap
from matplotlib import colormaps
from qim3d.io.logger import log from qim3d.io.logger import log
...@@ -104,8 +105,28 @@ def objects( ...@@ -104,8 +105,28 @@ def objects(
randRGBcolors[-1] = background_color randRGBcolors[-1] = background_color
# Create colormap # Create colormap
objects_cmap = LinearSegmentedColormap.from_list( objects = LinearSegmentedColormap.from_list(
"objects_cmap", randRGBcolors, N=nlabels "objects", randRGBcolors, N=nlabels
) )
return objects_cmap return objects
qim = LinearSegmentedColormap.from_list('qim',
[(0.6, 0.0, 0.0), #990000
(1.0, 0.6, 0.0), #ff9900
])
"""
Defines colormap in QIM logo colors. Can be accessed as module attribute or easily by ```cmap = 'qim'```
Example:
```python
import qim3d
display(qim3d.viz.colormaps.qim)
```
![colormap objects](assets/screenshots/viz-colormaps-qim.png)
"""
colormaps.register(qim)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment