Archive for April, 2007

Transparent Icons

Wednesday, April 25th, 2007

During the freeware release of ToggleUndoQueue I found out why the Outliner icons used for the commercial plug-ins showed up in weird colors under Linux and OSX. I had actually totally forgotten about the transparency in the XPM files.

Having icons with transparent background is also very nice if you’re running Maya’s UI with other than the default colors.

Since XPM files are just C code they can easily be opened with a text editor. You will find a header, the color allocation table and finally the image itself. Additionally you need to know how Maya will determine the transparent color.

The color allocation table will have an entry similar to this:

"` c #00ff00"

which, to make Maya recognize it as the background color, has to be changed into:

"` s bg c #00ff00"

Most important thing to note is that the files must not have more than 255 colors. Otherwise Maya won’t use transparency.