Sorting by Color

前端 未结 3 664
無奈伤痛
無奈伤痛 2021-01-31 04:23

I have a long list (1000+) of hex colors broken up in general color categories (Red, Orange, Blue, etc). When I show the list of colors in each category I need to show them in

3条回答
  •  悲哀的现实
    2021-01-31 05:16

    If you convert the colors to HSV space, you could potentially sort them by the hue, then the value.

    The hue will determine the color "category" - ie: red, blue, green, etc.

    The value and saturation will affect the "lightness" of the final color. You might need some experimentation to get the ideal sort, though.

提交回复
热议问题