Subject: FvwmTheme and gradients

From: Ben Winslow <[email-masked]>
Date: Mon, 1 Nov 1999 10:09:19 -0500 (EST)

I'd like to suggest a colorset flag to make it so that gradients are
rendered at the time they're requested--  This way, gradients for large
areas (i.e. FvwmBacker, menus) can be rendered at full size instead of being
stretched from the size that XQueryBestTile returns, and would therefore
look *much* better.  (If you don't believe me, try using FvwmBacker for a
gradient based background and also try to make it look smooth :)

-- 
Ben Winslow          / [email-masked]
freshmeat news squad / freshmeat: http://www.freshmeat.net
|Rain| @ IRC         / anynet: irc.anynet.org

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 2 Nov 1999 12:33:23 +0100

> gradient based background and also try to make it look smooth :)

I assume you are using H/V gradients.  The key to how the stretched
gradient looks is the number of colours used.  It won't help to
draw the gradient each time.  What you need to do is to create a
colour set with a high number of colours.  I have this in my config:

  MenuStyle * MenuFace VGradient 100 colour1 colour2
  TitleStyle  inactive VGradient 20 colour1 colour2

I.e. for menus that are much larger than window titles I use
much more colours in the gradient to make them look smooth.

BTW, this has nothing to do with the 'XQueryBestTile' call
in the menu code.  You are confusing 'tiling' with 'stretching'.
The tile size determines the width of vgradients and the height
of hgradients, i.e. how many pixels of the *same* colour are used
to tile the complete window.  The gradient itself is always drawn
in the full width/height of the menu.

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 2 Nov 1999 13:06:31 +0200

> gradient based background and also try to make it look smooth :)

Try:

*FvwmBackerDesk 0 Colorset 15
*FvwmThemeColorset 15 YGradient 2400 2 blue 50 green 50 blue
Module FvwmBacker

Smooth and nice enough. :)
This takes some seconds, but xv -root takes even more.

Regards,
Mikhael.

---

From: Ben Winslow <[email-masked]>
Date: Tue, 2 Nov 1999 14:44:27 -0500 (EST)

Around 1:06pm on Nov 2, 1999, Mikhael Goikhman spoke unto me:

MG# On 01 Nov 1999 10:09:19 -0500, Ben Winslow wrote:
MG# > 
MG# > 	I'd like to suggest a colorset flag to make it so that gradients are
MG# > rendered at the time they're requested--  This way, gradients for large
MG# > areas (i.e. FvwmBacker, menus) can be rendered at full size instead of being
MG# > stretched from the size that XQueryBestTile returns, and would therefore
MG# > look *much* better.  (If you don't believe me, try using FvwmBacker for a
MG# > gradient based background and also try to make it look smooth :)
MG# 
MG# Try:
MG# 
MG# *FvwmBackerDesk 0 Colorset 15
MG# *FvwmThemeColorset 15 YGradient 2400 2 blue 50 green 50 blue
MG# Module FvwmBacker
MG# 
MG# Smooth and nice enough. :)
MG# This takes some seconds, but xv -root takes even more.
MG# 
MG# Regards,
MG# Mikhael.
MG# --
MG# Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
MG# To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
MG# body of a message to [email-masked].
MG# To report problems, send mail to [email-masked]
MG# 

It still doesn't look very smooth for me at 1024x768@16bpp.  I can submit a
screenshot if you like...

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 3 Nov 1999 05:21:30 +0100

> screenshot if you like...

It will never look smooth on a 16 bit display.  Don't let the
65536 colours fool you:  The bits available for the r/g/b
values are very limited.  For example, if you have a gradient
from white to black, your X server can display about 30 shades
of gray in between, so if you use a gradient with 1000 colours,
970 of them would be wasted.  You'll get even less colours if
the starting colours are closer together (e.g. from 00/80/c0
to 00/c0/80 there are only a quarter of the colours in between).
To get truly smooth gradients you need at least 24 bitplanes.  

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Ben Winslow <[email-masked]>
Date: Wed, 3 Nov 1999 23:30:55 -0500 (EST)

Around 5:21am on Nov 3, 1999, Dominik Vogt spoke unto me:

DV# It will never look smooth on a 16 bit display.  Don't let the
DV# 65536 colours fool you:  The bits available for the r/g/b
DV# values are very limited.  For example, if you have a gradient
DV# from white to black, your X server can display about 30 shades
DV# of gray in between, so if you use a gradient with 1000 colours,
DV# 970 of them would be wasted.  You'll get even less colours if
DV# the starting colours are closer together (e.g. from 00/80/c0
DV# to 00/c0/80 there are only a quarter of the colours in between).
DV# To get truly smooth gradients you need at least 24 bitplanes.  
DV# 
DV# Bye
DV# 
DV# Dominik ^_^
DV# 
DV# 

When I think about it, you're exactly right (except I believe it's 40
shades, 2^(16/3)=40.317).  I guess this just goes to show how badly I need a
new video card :)  In the mean time, would dithering be a possible
alternative?  (This is what most other window managers do, which I notice
now upon closer inspection, but never noticed before).  I imagine dithering
is a real pain, so I'd understand why you may not want to impliment it, but
I also think it'd be advantageous to have support for it as well...

---

From: Tim Phipps <[email-masked]>
Date: Thu, 04 Nov 1999 09:14:59 +0000

Ben Winslow wrote:

> In the mean time, would dithering be a possible

It would be a lot simpler if you just created a dithered xpm in a real
graphics tool (e.g. gimp) and used that as a background tile.

Cheers,
Tim.