Subject: FVWM: Adjusting contrast of 3D effects.

From: Jean-Marc Lasgouttes <[email-masked]>
Date: Thu, 2 Nov 1995 16:45:02 +0100

Hi everybody!

I noticed that the shadows used by fvwm for shadow effects are much
brighter than what Motif of Xaw3d yield. I guess it comes from the
lines 

  r = bg_color.red % 0xffff;
  g = bg_color.green % 0xffff;
  b = bg_color.blue % 0xffff;
  
  r = r >>1;
  g = g >>1;
  b = b >>1;
  
  bg_color.red = r;
  bg_color.green = g;
  bg_color.blue = b;

in fvwm/colors.c, or similar snippets in modules. I'd like to see a
common function in libfvwm.a that uses a Contrast setting (either a
global setting in .fvwmrc or a compile time setting in
configure.h). Then we could have something like

  bg_color.red = (unsigned short)((bg_color.red*CONTRAST)/100);
  bg_color.green = (unsigned short)((bg_color.green*CONTRAST)/100);
  bg_color.blue = (unsigned short)((bg_color.blue*CONTRAST)/100);

Concerning the darker shadows, they seem to be always black. A similar
algorithm would be welcome. I don't know whether we can grab code from
Xaw3d and adapt it (Copyright problems, maybe?).

Anyway, I tried to change these things myself and, as expected, got
no satisfactory result. That's why I transmit this idea to the list.

Jean-Marc.
--
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Olly Stephens <[email-masked]>
Date: Thu, 02 Nov 1995 09:20:20 -0800

[email-masked] said:
|>
|> ..... I'd like to see a
|> common function in libfvwm.a that uses a Contrast setting (either a
|> global setting in .fvwmrc or a compile time setting in
|> configure.h). Then we could have something like
|> 
|>   bg_color.red = (unsigned short)((bg_color.red*CONTRAST)/100);
|>   bg_color.green = (unsigned short)((bg_color.green*CONTRAST)/100);
|>   bg_color.blue = (unsigned short)((bg_color.blue*CONTRAST)/100);
|>   
|> 
|> Concerning the darker shadows, they seem to be always black. A similar
|> algorithm would be welcome. I don't know whether we can grab code from
|> Xaw3d and adapt it (Copyright problems, maybe?).
|> 
|> Anyway, I tried to change these things myself and, as expected, got
|> no satisfactory result. That's why I transmit this idea to the list.
|> 

The initial version of FvwmForm suffered even more than the core and
other modules with a poor algorithm for selecting shades.  I submitted
a patch to it which, amongst other things, adopted the shading algorithm
from TK (John Ousterhout's window environment for TCL) which is one of
the best I've come across it.  This patch has been integrated into the
distribution version for quite a while now.

It would be good to move this code into libfvwm as a lot of modules try
and maintain a similar looking 3d effect to the core - common code is
the best way to do it.

I doubt if there's any copyright problems.  TCL and TK have very liberal
copyright and we're only poaching about 15 lines of code from it.

Olly