Re: A color selection tool (like xcolorsel)



Ian Zimmerman wrote:
Hi, I have finished a gtk2 program that does roughly the same as
xcolorsel (and my earlier gtk1 hack, xcolorsel-gtk).  In this
incarnation, it is really just a pairing of a color selection widget and
a list initialized from the rgb.txt file.  The cool parts are that you
can choose a color for the selector from the list, and dually, you can
sort the list (among other keys) on the euclidean distance from the
selected color in RGB space (so the closest matches bunch in the top of
the list).

One possible but not implemented feature is saving lists of colors in
the same format as rgb.txt (from the color selector palette).  Useful?

http://primate.net/~itz/gcolorsel-1.9.0.tar.gz

It was a good first program in gtk2, I think :-)  Especially because
I hope the tree view bugs I discovered in the process will be fixed.

Looks cool. There's a minor bug. If the rgb.txt (/etc/X11/rgb.txt) file doesn't exist then your program doesn't work. Here's how I fixed it:

--- gcolorsel-1.9.0/list.c      Thu Jun 17 01:04:58 2004
+++ gcolorsel-1.9.0.changed/list.c      Thu Jun 17 10:12:54 2004
@@ -168,8 +168,10 @@

   if (!(fp = fopen (rgb_fn, "r")))
     error (0, 0, "read_colors_file: %s", rgb_fn);
+  else{
   read_colors_fp (fp, rgb_fn, list, cs);
   fclose (fp);
+  }
 }



--
Keith Maika
http://kicken.mine.nu:8008/  - Personal Site.
http://wiser.kicks-ass.org:8008/  - Long-term Project.
http://www.fsf.org/philosophy/can-you-trust.html - Can you trust your computer? http://www.fsf.org/philosophy/no-word-attachments.html - Support Free Communication.



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