Which is most accurate way to distinguish one of 8 colors?

后端 未结 6 776
星月不相逢
星月不相逢 2021-02-09 06:00

Imagine we how some basic colors:

RED = Color ((196, 2, 51), \"RED\")
ORANGE = Color ((255, 165, 0), \"ORANGE\")
YELLOW = Color ((255, 205, 0), \"YELLOW\")
GREEN         


        
6条回答
  •  情歌与酒
    2021-02-09 06:21

    The colors module of my Goulib library does this fairly well, and much more. It defines a Color class that can be inited from several color spaces, and grouped in a Palette dictionary. Several palettes are predefined, notably one that is indexed by the html/matplotlib names. Each Color automagically recieves a name from the index of the nearest color in this palette, measured in Lab space (deltaE)

    see demo here http://nbviewer.jupyter.org/github/Goulu/Goulib/blob/master/notebooks/colors.ipynb

提交回复
热议问题