smsaladi / chimerax_viridis

Colorblind-friendly, perceptually uniform palettes for chimerax

Home Page:https://shyam.saladi.org/chimerax_viridis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DOI

chimerax_viridis

Script to add viridis and other colorblind-accessible (and perceptually uniform) palettes to ChimeraX. The default colormap for rainbow is set to turbo.

All the new colormaps (viridis, magma, inferno, plasma, cividis, turbo) can be used in ChimeraX wherever builtin colormaps can be specified (docs for see palette), e.g. instead of ... palette cyanmaroon ... , try ... palette viridis ....

Just run runscript viridis_colormaps.py and you are off!

preview comparing colormaps

Technical details

New color maps are added to the dictionary colors.BuiltinColormaps with their common name as key and colormap constructed with chimerax.core.colors.Colormap as value.

The following functions in chimerax.std_commands.color use rainbow by default (i.e. when cmap=None, see snippet below) and are monkey-patched with turbo instead.

* `_set_sequential_polymer`
* `_set_sequential_chain`
* `_set_sequential_residue`
* `_set_sequential_structures`
    if cmap is None:
        from chimerax.core import colors
        cmap = colors.BuiltinColormaps["rainbow"]

The new colormaps are added via their 256-hex colors from bokeh.palettes (not via named colors) to stay as true as possible to the original colormap specifications.

About

Colorblind-friendly, perceptually uniform palettes for chimerax

https://shyam.saladi.org/chimerax_viridis

License:MIT License


Languages

Language:Python 100.0%