{
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
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,
{
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
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;
#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;
}
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