[librsvg] rsvg-convert: Accept RGBA colors for the --background-color option



commit e997aadb13508831adf9aea78ce709a662771b8d
Author: Hao Guan <hguandl gmail com>
Date:   Thu Apr 9 14:02:47 2020 -0500

    rsvg-convert: Accept RGBA colors for the --background-color option

 rsvg-convert.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/rsvg-convert.c b/rsvg-convert.c
index 328059af..547b7972 100644
--- a/rsvg-convert.c
+++ b/rsvg-convert.c
@@ -577,11 +577,12 @@ main (int argc, char **argv)
                 exit (1);
             }
 
-            cairo_set_source_rgb (
+            cairo_set_source_rgba (
                 cr, 
                 ((background_color >> 16) & 0xff) / 255.0, 
                 ((background_color >> 8) & 0xff) / 255.0, 
-                ((background_color >> 0) & 0xff) / 255.0);
+                ((background_color >> 0) & 0xff) / 255.0,
+                ((background_color >> 24) & 0xff) / 255.0);
             cairo_rectangle (cr, 0, 0, unscaled_width, unscaled_height);
             cairo_fill (cr);
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]