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 >
Wrap
Text File
|
1991-12-06
|
539b
|
28 lines
/* Listing 1 */
#include <stdio.h>
#include <stdlib.h>
#define PAL_LEN 256
typedef struct
{
int red;
int grn;
int blu;
int num;
} pal;
pal palo[ PAL_LEN ]; /* original palette */
pal pals[ PAL_LEN ]; /* sorted palette */
/* index for the sorted palette */
int redindex[ PAL_LEN ];
/* prototypes */
int closest( int red, int green, int blue );
long dist( int red, int green, int blue, int num );
void sort_color();
int color_comp( const void *a, const void *b );