Coder Social home page Coder Social logo

Comments (2)

jbednar avatar jbednar commented on May 21, 2024 1

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:

image

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.

jbednar avatar jbednar commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.