What is the standard way of accessing X11 color mappings in C/C++?

Googling around, I see this list, which provides a useful name to rgb mapping.

Of course, I can easily copy this file, store it somewhere, and read it, but I was wondering, is there a standard way of accessing this list from C/C++ from some standard location (hopefully, without a lot of hassle)?

Even a standard location in a *nix system would be useful, since reading/parsing the file is trivial.

Fwiw, I am running gcc 4.7.3 on Ubuntu 13.04.

Answers


As I recall, and Wikipedia (not a great reference I know)

X11root/lib/X11/rgb.txt

which is likely:

/usr/lib/X11/rgb.txt


Googling around some more, it looks like the standard location may be:

/etc/X11/rgb.txt

For checking out the colors, the xcolors program is useful.

Install with sudo apt-get install xcolors


Need Your Help

How can I use relative urls in ajax requests within trigger.io apps on Android 4.4 (kitkat)?

ajax jquery-mobile android-webview trigger.io android-4.4-kitkat

My trigger.io-bundled jquery-mobile app works great on both android < 4.4 and iOS devices but refuses to load any relative pages, scripts etc. on android 4.4 once jquery mobile loads. Afaik, jqm...

AspectJ beginner question

java aspectj

I am starting to learn AspectJ. From reading tutorials, I know that I can weave aspects into already compiled class files. However, I just cannot figure out the command that allows me to merge a co...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.