How to use colors in Motif

c++, motif, user-interface, x11

Solution

See here for an answer in the function `Pixel convert_color_name_to_pixel`, and also here.

Hope this helps.

Problem

I'm new to GUI programming in C and Linux, and I'm having a hard time with it. It seems like a fairly simple/straightforward thing, but I can't find any answers googling. I want to add a background color to a widget. XmNbackground seems to be what I want to use, but I don't understand what I set it to, like a simple color blue, how do I get "blue" to set XmNbackground color to that?

Original source