Dear friends,

I've started a project where I need to sort a list of colors, by color. At
first glance, it sounded easy, but it's proven to be anything but simple.

So far, sorting using HSV values seems to be best, but there are odd gaps
and jumps, particularly when near-white values are involved. Perhaps it's
just the limited display range of my monitor that's getting me confused?

Here's what I've been using to compare the colors:

      if Color1.Hue>Color2.Hue then
        SwapEm=True
        
      elseif Color1.Hue=Color2.Hue then
        
        if Color1.Saturation<Color2.Saturation then
          SwapEm=True
          
        elseif Color1.Saturation=Color2.Saturation then
          
          if Color1.Value>Color2.Value then
            SwapEm=True
          end if
        end if
      end if

Does anyone have any other suggestions for how to tackle this? There's
nothing in the NUG archives, and even Google turned up pretty much empty
handed.

Hmmm...

- John


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to