*** empty log message ***
authorroot <root>
Tue, 31 Jan 2006 16:57:35 +0000 (16:57 +0000)
committerroot <root>
Tue, 31 Jan 2006 16:57:35 +0000 (16:57 +0000)
src/init.C
src/main.C
src/rxvttoolkit.C
src/rxvttoolkit.h
src/rxvtutil.h

index fe578e25116a8c262661636add2a33241fd2b81c..2bec95fdc3368256d9a613f3262aba89266bd1f1 100644 (file)
@@ -708,7 +708,7 @@ rxvt_term::Get_Colours ()
       {
         rxvt_rgba c;
         pix_colors[Color_fade].get (this, c);
-        pix_colors_unfocused[i] = pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), c);
+        pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused[i],c);
       }
 #endif
 
@@ -749,7 +749,7 @@ rxvt_term::Get_Colours ()
       xcol[0].get (this, c0);
       xcol[1].get (this, c1);
 
-      pix_colors[Color_bottomShadow] = xcol[1].fade (this, 50);
+      xcol[1].fade (this, 50, pix_colors[Color_bottomShadow]);
 
       /* topShadowColor */
       if (!xcol[1].set (this,
index d12e2b0360ee69b622a2a62acd89faff0a48a3fa..b1968056bc7674a07339b1f9556a30e8203d2b06 100644 (file)
@@ -947,7 +947,7 @@ done:
     {
       rxvt_rgba c;
       pix_colors [Color_fade].get (this, c);
-      pix_colors_unfocused [idx] = pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), c);
+      pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
     }
 #endif
 
index a5c828b4f6b11237880b928259aa267d9797a99d..755e8bb25650898e42468d7e617ceb463ffb6a5b 100644 (file)
@@ -641,8 +641,10 @@ rxvt_color::set (rxvt_screen *screen, const char *name)
 
   if (1 <= sscanf (name, "[%hd]%n", &c.a, &skip))
     {
+     printf ("X %d\n", c.a);
       c.a = lerp<int, int, int> (0, rxvt_rgba::MAX_CC, c.a);
       name += skip;
+     printf ("y %04x\n", c.a);
     }
   else
     c.a = rxvt_rgba::MAX_CC;
@@ -749,23 +751,20 @@ rxvt_color::free (rxvt_screen *screen)
 #endif
 }
 
-rxvt_color
-rxvt_color::fade (rxvt_screen *screen, int percent, const rxvt_rgba &to)
+void
+rxvt_color::fade (rxvt_screen *screen, int percent, rxvt_color &result, const rxvt_rgba &to)
 {
   rxvt_rgba c;
   get (screen, c);
 
-  rxvt_color faded;
-  faded.set (
+  result.set (
     screen,
     rxvt_rgba (
-      lerp (to.r, c.r, percent),
-      lerp (to.g, c.g, percent),
-      lerp (to.b, c.b, percent),
-      lerp (to.a, c.a, percent)
+      lerp (c.r, to.r, percent),
+      lerp (c.g, to.g, percent),
+      lerp (c.b, to.b, percent),
+      lerp (c.a, to.a, percent)
     )
   );
-
-  return faded;
 }
 
index 4ac66832f5cfea7155a50e86c06eb4a16b693c60..6932b6ff69e08c8b6e96df3c28a674cdb7162c26 100644 (file)
@@ -257,7 +257,7 @@ struct rxvt_color {
   bool set (rxvt_screen *screen, const char *name);
   bool set (rxvt_screen *screen, const rxvt_rgba &color);
 
-  rxvt_color fade (rxvt_screen *screen, int percent, const rxvt_rgba &to = rxvt_rgba (0, 0, 0));
+  void fade (rxvt_screen *screen, int percent, rxvt_color &result, const rxvt_rgba &to = rxvt_rgba (0, 0, 0));
 };
 
 #endif
index 618b863693a6def1dc54c5d2989be456f3ef8d6a..82934e80e84ee7b04040d2fd49a68e5bb044ee87 100644 (file)
@@ -63,7 +63,7 @@ template<typename T, typename U, typename P>
 static inline
 T lerp (T a, U b, P p)
 {
-  return (int(a) * int(p) + int(b) * int(100 - p)) / 100;
+  return (long(a) * long(100 - p) + long(b) * long(p) + 50) / 100;
 }
 
 // some bit functions, xft fuck me plenty