sorting colors

Different people will sort a color palette in different ways. Our goal was to find a sorting mechanism that looked pleasing to the eye, but of course the results are completely subjective.

  • For aesthetics, we prefer the YIQ sort. It highlights trends in value change, but information about hue variation is hidden and sometimes invisible.
  • To communicate more information about hues, HSV sorting is by far superior, but it lacks the pleasant gradient-effect of the YIQ sort.
  • RGB sorting proves inferior to HSV and YIQ, though the results can still be interesting.
  • HSV sort is excellent for grouping colors of similar hues, but the IYQ and YIQ sorts also do this well and they can look cleaner than their HSV counterpart.


“web” palette sorted by saturation. see the sortpal pages for fuller versions.  It shows a set of color palettes, sorted by the various attributes like it’s redness, or brightness, or saturation. For example, in the “red” row, the reddest colors are at the far left and decreasingly red colors to the right. The width of the color depends on the number of colors in the palette.

Lots of ways to sort them mathematically. Some map well to what people perceive as correct. Some do not. e.g. web palette sorted by proximity in rgb colorspace:

Different color palettes can be chosen, including the 216 “web safe” palette (wiki), theX11/css “named” colors (wiki), the xkcd color survey (xkcd color survey), a rough approximation of the spot colors often used in print, a Hilbert curve through rgb space(wiki), misc artistic palettes, etc.

sorting methods:

  • Sorting by one component of a color space, the most obvious being the red, blue, green values of RGB:
  • Hue, saturation, and value (HSL and HSV) is another color space, that maps a lot more naturally to how people understand colors. e.g. web palette sorted by hue, saturation, value, lightness, respectively.

  • sorting by proximity in the 3d color space. The idea being to start at the origin, and find the closest colors in 3d.

The code is up at github. No promises to it’s correctness or functionality. secondary and tertiary parameters sort as well (hsv3d, and chroma ) mostly just to stabilize the sorts.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


Just another site

Jing's Blog

Just another site

Start from here......







Just another site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision


Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness



Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

John's Weblog

Just another weblog

I Am That I Am

Chasing tomorrow's sunrise.

%d bloggers like this: