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

后端 未结 6 766
星月不相逢
星月不相逢 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-09 06:26

    Treat colors as vectors and count distance between the given and each of them and choose the one, which is the least. The simplest distance can be: |a1 - a2| + |b1 - b2| + |c1 - c2|.

    Read this too: http://answers.yahoo.com/question/index?qid=20071202234050AAaDGLf, there is a better distance function described.

提交回复
热议问题