IM normally uses SVG colorname before X11 colornames.
Unfortunately there are a few colornames that are conflicting between the two color systems
See IM Examples, Color Basices, Color Name Conflicts
http://www.imagemagick.org/Usage/color_ ... _conflicts
The problem...
The XPM image file format must use X11 color names for both read and write, and not SVG colornames.
When reading in a XPM image using of the the conflict colors (such as "purple") for example...
Code: Select all
/* XPM */
static char *purple_xpm[] = {
/* width height ncolors chars_per_pixel */
"1 1 1 1",
/* colors */
"a c purple",
/* pixels */
"a"
};
Code: Select all
convert purple.xpm xpm:-
Code: Select all
/* XPM */
static char *xpm__[] = {
/* columns rows colors chars-per-pixel */
"1 1 1 1 ",
" c #808000008080",
/* pixels */
" "
};
It is however smart enough to know that when writing not to use SVG "purple" so it output #808000008080"
so the write is good.
Quick test for writing a correct X11 "purple"
Code: Select all
convert xc:'#a020f0' xpm:-
/* XPM */
static char *xpm__[] = {
/* columns rows colors chars-per-pixel */
"1 1 1 1 ",
" c purple",
/* pixels */
" "
};