Tobias DiPasquale on Thu, 09 Jan 2003 07:21:03 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] xpm color conversion


Stephen Gran wrote:

Hello all,

This is mostly for Leonard Rosenthal, since we talked about it earlier
tonight, but I thought I'd send it to the list so other people could
benefit from the feedback.

I have to (policy, you know) convert an icon from many many colors down
to 24.  I gave mogrify a try, there were still errors spit out about
strange colors, so I kept looking.  I tried xpmtopnm and then pnmquant
and then pnmtoxpm - same kind of errors.  Tonight I tried convert with
the -colors option, same errors.  They are as below:

E: kcdlabel: menu-icon-has-bad-colors
/usr/share/apps/kcdlabel/icons/medium/locolor/apps/kcdlabel.xpm:
#1919191919190000, #4C4C4C4C4C4C0000, #6666666667670000,
#7F7F000000000000, #7F7F00007F7F0000, #7F7F7F7F00000000,
#B2B2B2B2B2B20000

As the icon in question is an .xpm, I can verify that these are in fact
listed as the color codes to be used.  It displays fine, but I have a 24
bit display.

This is a lintian error, BTW (an error checker for Debian packages).
What seems odd to me is that those really don't seem like real hex color
codes - can someone who knows more about colors and that end of thing
give me a pointer to a good tutorial, or at least clue me in as to why I
keep coming up with these colors that are not the (at least to me) 6
digit length that I'm used to seeing? I'm expecting #191919, #4c4c4c,
and so on - not these 16 character-length strings.


An XPM file is nothing but a char[] in C. Open the .xpm with a text file and see for yourself. Also, the reason you are seeing the 16-character strings is because the icon is 16 pixels wide, yes? Edit it by hand if the tools aren't working for you.

--
Tobias DiPasquale
http://cbcg.net/

_________________________________________________________________________
Philadelphia Linux Users Group        --       http://www.phillylinux.org
Announcements - http://lists.netisland.net/mailman/listinfo/plug-announce
General Discussion  --   http://lists.netisland.net/mailman/listinfo/plug