Apr-08-2021, 07:35 PM
I want to make status indicator lamps for my Qt based GUI. The lamps will display a different image based on the value of the signal they monitor.
In the past I used .xpm files to define my lamp icons. XPM files have a color table that defines all the colors used in the icon. I allocated the first 9 colors in the table to be background, background highlight, background shadow, foreground, foreground highlight, foreground shadow, fill color, fill color highlight and fill color shadow. My icon class had methods for setting the background, foreground and fill color that used an algorithm to calculate the shadow and highlight versions of each color and modify the color table. With shadow and highlight colors it was easy to make a lamp with a bezel that matched the background, or to make a hot spot or a shadow in my lamp bulb.
I would like to do something similar with my new indicator lamps and am looking for graphics file formats where you can define "programmable colors". What file formats and Python packages should I investigate?
In the past I used .xpm files to define my lamp icons. XPM files have a color table that defines all the colors used in the icon. I allocated the first 9 colors in the table to be background, background highlight, background shadow, foreground, foreground highlight, foreground shadow, fill color, fill color highlight and fill color shadow. My icon class had methods for setting the background, foreground and fill color that used an algorithm to calculate the shadow and highlight versions of each color and modify the color table. With shadow and highlight colors it was easy to make a lamp with a bezel that matched the background, or to make a hot spot or a shadow in my lamp bulb.
I would like to do something similar with my new indicator lamps and am looking for graphics file formats where you can define "programmable colors". What file formats and Python packages should I investigate?