#!/bin/sh

XRGB=/usr/lib/X11/rgb.txt

cat << _EOH_
/*  $Id$

    Part of XPCE
    Designed and implemented by Anjo Anjewierden and Jan Wielemaker
    E-mail: jan@swi.psy.uva.nl

    Converted colour database from X11.
*/

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note: This file is GENERATED from  $XRGB   on  a  Unix machine using the
command mkxcolours from the xpce/src/msw directory.

DO NOT EDIT!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

typedef struct
{ unsigned char red;
  unsigned char green;
  unsigned char blue;
  const char   *name;
} xcolourdef;

static xcolourdef x11_colours[] =
{
_EOH_

sed -e 's/[ 	]*\([0-9]*\)[ 	]*\([0-9]*\)[ 	]*\([0-9]*\)[ 	]*\(.*[a-zA-Z0-9]\)/ { \1, \2, \3, "\4" },/' \
    -e 's/ \([0-9]\),/   \1,/g' \
    -e 's/ \([0-9][0-9]\),/  \1,/g' $XRGB

cat << _EOT_
  {   0,   0,   0, NULL }
};
_EOT_
