Comments (2)
The way the categorical colors are generated is to create a gamut of possible colors, then iteratively choose colors within that gamut that are most dissimilar from all the preceding colors. You could use a color-blind-safe definition of color similarity when doing so, but that would require modifying the underlying code. I think it's probably easier to simply prune out non red-green colorblind-safe colors by eliminating either the green or the red portion of the gamut. In fact, the cool
and warm
Glasbey variants already do this:
These color sets were not intentionally constructed to be colorblind safe, and you can probably do a better job if you have a good model to guide which colors to select, pruning specifically the ones likely to be confused by a dichromat. We'd be happy to accept a contribution of improved cool
or warm
color sets that are specifically validated for their colorblind safety properties, using either method (dichromat-safe color similarity metric, or color space pruning).
In any case, note that the specific set you mention (glasbey_category10
) is constructed by taking the first 10 colors as fixed (from the externally defined D3 category10
colormap). Those 10 colors include red and green, so any color set starting with those colors will never be colorblind safe. So it is not possible to create anything like glasbey_category10
, intended as a drop-in replacement for and extension of category10
; it would need to be something like our cool
or warm
palettes that avoid the confusing red/green combination.
from colorcet.
Closing since there's a solution for now, but we'd still be happy to accept a specifically constructed colorblind-safe categorical map.
from colorcet.
Related Issues (20)
- "About Us" page refers to BSD license rather than Creative Commons HOT 2
- Over 300 test failures for `=dev-python/colorcet-2.0.6` HOT 3
- README not displayed on PyPI
- License in repository is CC-BY, but website says BSD HOT 7
- Support Python 3.12 HOT 3
- remove pyct / param dependency HOT 2
- Build breaks: ImportError: cannot import name '__version__' from 'param._version' HOT 1
- Add glasbey_tableau10? HOT 3
- swatch() needs docstring
- Update colorcet to upstream, especially new Gouldian Parula replacement HOT 1
- Possibility of change in License info on pypi from "Other/Proprietary License (CC-BY License)" to more explicit Creative Commons Intl ? HOT 9
- Allow more aliases HOT 1
- color palette name is not recognized HOT 3
- colorcet docs main webpage still refer to colorcet 1.0.0 HOT 1
- Some categorical colormaps are given as list of numerical RGB instead of list of hex strings HOT 2
- HoloViews warning when executing `swatches`
- matplotlib.cm.get_cmap returns a copy in 3.6.0 HOT 2
- Deprecation warning from matplotlib register_cmap HOT 1
- ValueError: A colormap named "cet_gray" is already registered HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colorcet.