Gcolor3 - a simple color chooser dialog in GTK3, much alike gcolor2.

Hello everyone,

Here I am, accouncing any of my projects publicly for the first time! I am trying to switch to as much GTK3 applications as possible (and, ultimately, try ditch as many GTK2). It has always bothered me that there is no GTK3 alternative to something as simple as Gcolor2. Today, I just quickly whipped it up myself, after having gained some experience in GTK3 from my previous (yet unnanounced) project.

It's very, very simple (93 SLOC, of which most are the About dialog ) and for now, it consists of a color wheel and number of sliders and entry boxes for color parameters. You can also pick a color on the desktop. I never used the color-saving feature of Gcolor2, so for now I have not implemented it. Anything is possible though, upon request

Feedback - on everything; the application itself and the Makefile - would be appreciated. My experience with Makefiles is limited, so if anything could be improved (in general, or to help compatibility with other distributions for example) please let me know!

Update: Gcolor3 now has a treeview inside an expander (just as Gcolor2, of course) which lists your saved colors. These colors are also exported to a file ($HOME/.rgb.txt), just like - of course - Gcolor2.

I am currently aware of one bug, but I have not yet discovered why. A quick example: save three colors:

#FF0000 RED
#00FF00 GREEN
#0000FF BLUE

Then, delete GREEN. As expected, the green color is removed from the treeview and the rgb.txt file. However, also the blue color is removed from the rgb.txt file. If you could help me decipher a pattern, I would appreciate this

If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Update: Gcolor3 now has a treeview inside an expander (just as Gcolor2, of course) which lists your saved colors. These colors are also exported to a file ($HOME/.rgb.txt), just like - of course - Gcolor2.

I am currently aware of one bug, but I have not yet discovered why. A quick example: save three colors:

#FF0000 RED
#00FF00 GREEN
#0000FF BLUE

Then, delete GREEN. As expected, the green color is removed from the treeview and the rgb.txt file. However, also the blue color is removed from the rgb.txt file. If you could help me decipher a pattern, I would appreciate this

Also while saving even when we click on cancel, the color is getting saved.

Heres the patch for both of this, just very minor change, so adding it in here

I guess for while printing to buffer 'newstuff' it overwrites the existing one, since it starts from the first position always.

I looked through the documentation to see if writing back the buffer to itself should cause any problem, but didn't find anything, However, that is what is causing the error.Do let me know if you find any documentation on this.

Just pushed a big update to GitHub: the source is now split across multiple files for easier editing and I cleaned it up a tad. No features were removed or added, but I thought I'd give you a heads up in case you rebuilt it and notice new bugs

If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

I've just imported Gcolor3 into Anjuta for easier project management and to be (more easily) compatible with other distributions. I'm still exploring things (I still have to figure out how to install the .desktop file, for example) but I thought I'd give you a heads up. There's no actual changes to the code, but a big advantage from this switch is the enabling of translations.

Yes, that's right, you can now translate Gcolor3 in your own language. Since it's a small application, the translating should not take more than five minutes. I would highly appreciate your efforts if you could translate! Instructions can be found in the GitHub repository's README.md.

Last edited by Unia (2013-06-09 19:51:01)

If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

As we're nearing a stable 1.0 release (I finally solved the bug that was there since I added the treeview and that I've been looking into for a month ), I thought it would be time to have a Page on GitHub. Perhaps this will help spread the word on Gcolor3!

I was just going to switch gcolor2 to this, but I gotta admit I don't like the new layout at all.

it takes too much screen estate compared to old version. also the gtk header bar looks very ununiform, at least with my theme and language settings. also the bottom of the window looks weird for my eye somehow, now that there's no spacing below the color selector.

maybe you could make the header more compact somehow, by using icons instead of text for example, or maybe unifying the buttons to a single menu although that would make it slightly less 'usable'.the rgb spin buttons should be thinner as well. The maximum value for those has 3 digits, and currently there's space for nearly 15 digits which seems just pointless.

please don't take this the wrong way. I really appreciate what you've done, simply wanted to give some honest constructive criticism