After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 349190 - Don't hard-code colors
Don't hard-code colors
Status: RESOLVED DUPLICATE of bug 601370
Product: baobab
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Baobab Maintainers
Baobab Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-29 16:14 UTC by Shaun McCance
Modified: 2020-11-15 14:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Shaun McCance 2006-07-29 16:14:31 UTC
Boabab has hard-coded colors in the form of PNG files that it scales/crops/whatever to make the status bars.  This will cause problems for themes.  In addition, the red and green that are being used are nearly identical to people with red-green color deficiency.

Boabab should extract colors from the user's current theme, and then draw the bar graphs with Cairo or something.
Comment 1 Paolo Borelli 2006-07-29 18:53:47 UTC
Definately. Do you know if there are this kind of cell renderers already available somewhere (gtk's progressbar cellrenderer is not very sexy for this stuff)
Comment 2 Paolo Borelli 2006-07-30 17:20:41 UTC
btw, which theme colors can we use? Displaing just a progress with the standard widget colors doesn't cut it
Comment 3 Shaun McCance 2007-03-23 17:24:37 UTC
So I see on trunk that you're no longer using the PNG images, but instead are drawing the bars.  The colors are still hard-coded though.  The green is much different from what the green PNG looked like, and it's no longer isdistinguishable from the red.  Unfortunately, it's now indistinguishable from the yellow.

You should really try to calculate the colors from the user's theme.  You can look at how Yelp does this:

http://svn.gnome.org/viewcvs/yelp/trunk/src/yelp-settings.c?revision=2742&view=markup

I'd like to rework most of that, but it's a start.

You still have to take care that auto-generated colors are color-blind-friendly.  A good approach is to vary the saturation or brigthness value along with the hue.  This sequence will probably work well:

Low-saturated blue-tinted green
Medium-saturated everyday yellow
High-saturated bright red

Giving the green a blueish tint will help distinguish it from both yellow and red.  This is, by the way, exactly the approach taken by traffic lights in the US.
Comment 4 nodiscc 2012-12-05 02:08:26 UTC
This bug was reported against a version which is not supported any more. Developers are no longer working on this version so there will not be any bug fixes for it.
Can you please check again if the issue you reported here still happens in a recent version of GNOME and update this report by adding a comment and adjusting the 'Version' field?

Again thank you for reporting this and sorry that it could not be fixed for the version you originally used here.

Without feedback this report will be closed as INCOMPLETE after 6 weeks.
Comment 5 Shaun McCance 2012-12-05 02:18:51 UTC
The developers can't ascertain for themselves whether the program still works this way? NEEDINFO should only be used when you actually need info from the reporter, not when you could find the info yourself.
Comment 6 nodiscc 2012-12-05 03:21:51 UTC
Hi, actually I don't have that problem on my machine. Colors in baobab are very distinguishable, but I guess that's more a personal threshold, and I'm not even colorblind.

I have set this NEEDINFO because it was not touched for a long time, and I was trying to triage a bit. Not sure if the colors are still a problem for you, are they?

Thanks
Comment 7 Jean-François Fortin Tam 2014-06-15 16:46:14 UTC
Hi Shaun, there's bug 601370 that has a patch (attachment #181149 [details]). Should we consider this a duplicate of 601370, or vice versa?
Comment 8 André Klapper 2020-11-15 14:12:27 UTC

*** This bug has been marked as a duplicate of bug 601370 ***