Fedora Linux Support Community & Resources Center
  #1  
Old 7th December 2011, 11:49 PM
tuxor Offline
Registered User
 
Join Date: Mar 2011
Posts: 177
linuxfirefox
GTK: Window transparency

Look at the following screenshot:
Click image for larger version

Name:	compare.png
Views:	71
Size:	14.4 KB
ID:	22279
Left: OSD from gnome-settings-daemon (http://git.gnome.org/browse/gnome-se...d-osd-window.c), coded in C with Cairo and GTK
Right: I coded this one in Python with PyCairo and PyGtk

The transparent black rounded rectangles have the same color. They appear to be the same when looked at on white background. But they differ significantly on the black background.

How did the gnome-programmers achieve, that their "leve of transparency" adapts to the background?
__________________
Fedora (Gnome) on Lenovo ThinkPad T400s
Fedora (Xfce) on IBM ThinkPad X31
Reply With Quote
  #2  
Old 8th December 2011, 01:48 AM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,847
linuxfirefox
Re: GTK: Window transparency

My guess would be, instead of e.g. 50% transparent black, maybe e.g. 75% transparent dark grey, so that on white the overall effect is the same level of darkening, but on black the tendency is to lighten.

Gareth
Reply With Quote
  #3  
Old 8th December 2011, 07:57 AM
tuxor Offline
Registered User
 
Join Date: Mar 2011
Posts: 177
linuxfirefox
Re: GTK: Window transparency

Quote:
Originally Posted by Gareth Jones View Post
My guess would be, instead of e.g. 50% transparent black, maybe e.g. 75% transparent dark grey, so that on white the overall effect is the same level of darkening, but on black the tendency is to lighten.

Gareth
Thanks, I don't know, why I didn't think of this myself. Of course, the trick is: 75% alpha + 7% grey, instead of 70% alpha and 0% grey (i.e. black).
__________________
Fedora (Gnome) on Lenovo ThinkPad T400s
Fedora (Xfce) on IBM ThinkPad X31
Reply With Quote
Reply

Tags
gtk, transparency, window

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with window transparency HMSS013 Using Fedora 4 22nd December 2007 09:29 AM
Transparency hdavy2005 Using Fedora 1 9th March 2007 09:33 PM
Transparency TraceTheory Using Fedora 6 28th October 2006 05:42 PM
How can i have transparency? motoboy Using Fedora 1 21st August 2005 06:48 PM
Transparency TheRicXperience Fedora Focus 1 22nd April 2005 04:35 PM


Current GMT-time: 10:53 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat