1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-15 17:47:09 +00:00

Fixed gradients to actually use both end colors

Signed-off-by: Brenden Matthews <brenden@diddyinc.com>
This commit is contained in:
Kevin Lyles 2010-08-05 21:33:49 -05:00 committed by Brenden Matthews
parent f055cfefad
commit eb0a4cc418

View File

@ -119,7 +119,7 @@ unsigned long *do_gradient(int width, unsigned long first_colour, unsigned long
for (i = 0; i < width; i++) { for (i = 0; i < width; i++) {
int red3 = 0, green3 = 0, blue3 = 0; // colour components int red3 = 0, green3 = 0, blue3 = 0; // colour components
float factor = ((float)(i + 1) / width); float factor = ((float) i / (width - 1));
/* the '+ 0.5' bit rounds our floats to ints properly */ /* the '+ 0.5' bit rounds our floats to ints properly */
if (red1 >= red2) { if (red1 >= red2) {