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 413941 - Add support for RGBA colors in Pango for opacity styling
Add support for RGBA colors in Pango for opacity styling
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.16.x
Other All
: Normal enhancement
: Medium API
Assigned To: pango-maint
pango-maint
: 506890 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-03-02 18:10 UTC by Alexander “weej” Jones
Modified: 2015-08-15 03:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Screenshot example (70.39 KB, image/png)
2007-03-02 18:11 UTC, Alexander “weej” Jones
Details
Before (18.95 KB, image/png)
2007-03-03 16:07 UTC, Alexander “weej” Jones
Details
After (mockup) (18.90 KB, image/png)
2007-03-03 16:07 UTC, Alexander “weej” Jones
Details

Description Alexander “weej” Jones 2007-03-02 18:10:51 UTC
Hold the WONTFIX button for a second, please... :)

Very frequently do applications have a desire to subdue some text, somewhat. Unfortunately, they resort to using some flat colours taken from the theme or whatever to do this.

See the example with Gossip. The status message text colour is taken from an arbitrary symbolic in the active Gtk theme, but it reverts to the normal foreground colour when you highlight a row. As you can see in the screenshot, there is some visual inconsistency here, as the status message is no longer in a subdued colour.

I think sticking with foreground colour and just modulating the transparency somewhat would provide better looking results. If Pango had support for RGBA colours rather than just RGB as we have right now, this would be a piece of cake and would save us having to resort to using Cairo directly.

What do you think?
Comment 1 Alexander “weej” Jones 2007-03-02 18:11:10 UTC
Created attachment 83746 [details]
Screenshot example
Comment 2 Alexander “weej” Jones 2007-03-03 16:07:04 UTC
Created attachment 83831 [details]
Before
Comment 3 Alexander “weej” Jones 2007-03-03 16:07:35 UTC
Created attachment 83833 [details]
After (mockup)
Comment 4 Behdad Esfahbod 2007-03-03 22:07:35 UTC
Would be nice, yeah.
Problem is that PangoColor is public, with no padding.  So we can't do without introducing another type.

Probably easier to add a new attribute for alpha only.
Comment 5 Alexander “weej” Jones 2007-06-01 00:10:20 UTC
OK, well can we do that now then, with the intention of tidying this up next ABI+API break?

I'm really keen to start harnessing opacity rather than resorting to unreliable colour maths!
Comment 6 Behdad Esfahbod 2007-07-25 23:18:50 UTC
PangoAttrOpacity is the way to go then.
Comment 7 Behdad Esfahbod 2007-07-25 23:21:47 UTC
We can hack pango markup to accept things like #ffffff88 that add both a color and an opacity attribute, but it may be simpler to just add an opacity attribute to the span tag.

Humm, the problem with adding opacity instead of making colors support alpha is that we have multiple colors: foreground, underline, background.  Which ones should the opacity attribute modify?
Comment 8 Alexander “weej” Jones 2007-07-25 23:33:14 UTC
foreground and underline, not background.
Comment 9 Behdad Esfahbod 2008-01-02 20:53:33 UTC
*** Bug 506890 has been marked as a duplicate of this bug. ***
Comment 10 Alexander “weej” Jones 2008-03-29 04:20:53 UTC
Behdad, can we resurrect this discussion? Are we in a position to implement this?
Comment 11 Behdad Esfahbod 2008-03-31 12:01:19 UTC
Not sure.  I'll get back to it when I'm back from vacation...
Comment 12 Alexander “weej” Jones 2008-09-24 19:35:00 UTC
Ultimately I think having all colours be RGBA is the best way. So when can we break ABI for PangoColor?
Comment 13 Behdad Esfahbod 2008-09-24 19:36:34 UTC
No.  I have some plans to allow type inheritance in the attributes.  That may help.