home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_02 / 1002036a < prev    next >
Text File  |  1991-12-06  |  539b  |  28 lines

  1. /* Listing 1 */
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. #define PAL_LEN 256
  7.  
  8. typedef struct
  9.     {
  10.     int red;
  11.     int grn;
  12.     int blu;
  13.     int num;
  14.     }   pal;
  15.  
  16. pal palo[ PAL_LEN ];        /* original palette */
  17. pal pals[ PAL_LEN ];        /* sorted palette   */
  18.  
  19. /* index for the sorted palette */
  20. int redindex[ PAL_LEN ];
  21.  
  22. /* prototypes */
  23.  
  24. int closest( int red, int green, int blue );
  25. long dist( int red, int green, int blue, int num );
  26. void sort_color();
  27. int color_comp( const void *a, const void *b );
  28.