Sorting by spectrum

Kenneth Brody kenbrody at bestweb.net
Wed Mar 3 19:02:38 PST 2004


Walter Vaughan wrote:
> 
> I know this seems like a weird idea, but I know several developers
> are in the flooring industry and someone may have come up with
> a solution....
> 
> I need to sort records by their RGB (Red/Green/Blue) value
> into spectrum order.
> 
> I have three fields with 0-255 values. (0/0/0 would be black,
> 255,255,255 would be white).
> 
> Any ideas, please post 'em here, cause I really
> don't even have an idea how you could map cycling
> or cosine shaped values into something sortable.
[...]

If you convert RGB into HSV, you hay be able to sort on some formula
based on that.  Unfortunately, there is no perfect linear sort based
on a two-dimensional value.  (ie: what comes next to a give HSV value,
the next H or the next S?)

-- 

+---------+----------------------------------+-----------------------------+
| Kenneth |     kenbrody at spamcop.net      | "The opinions expressed     |
|    J.   |    http://www.hvcomputer.com     |  herein are not necessarily |
|  Brody  |      http://www.fptech.com       |  those of fP Technologies." |
+---------+----------------------------------+-----------------------------+




More information about the Filepro-list mailing list