[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/svg-lib d8b8aaf312 1/5: Transparent icon background whe
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/svg-lib d8b8aaf312 1/5: Transparent icon background when no background color is given |
|
Date: |
Wed, 22 Nov 2023 03:58:38 -0500 (EST) |
branch: externals/svg-lib
commit d8b8aaf31296c1a8267045c6d2cdbd4ff9214f47
Author: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Commit: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Transparent icon background when no background color is given
---
svg-lib.el | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/svg-lib.el b/svg-lib.el
index ccf1572445..e440508aa1 100644
--- a/svg-lib.el
+++ b/svg-lib.el
@@ -211,11 +211,12 @@ to the default face)."
(defun svg-lib-convert-color (color-name)
"Convert Emacs COLOR-NAME to #rrggbb form.
If COLOR-NAME is unknown to Emacs, then return COLOR-NAME as-is."
-
- (let ((rgb-color (color-name-to-rgb color-name)))
- (if rgb-color
- (apply #'color-rgb-to-hex (append rgb-color '(2)))
- color-name)))
+
+ (when color-name
+ (let ((rgb-color (color-name-to-rgb color-name)))
+ (if rgb-color
+ (apply #'color-rgb-to-hex (append rgb-color '(2)))
+ color-name))))
;; SVG Library style build from partial specification
@@ -528,11 +529,12 @@ given STYLE and style elements ARGS."
(when (>= stroke 0.25)
(svg-rectangle svg box-x box-y box-width box-height
:fill foreground :rx radius))
- (svg-rectangle svg (+ box-x (/ stroke 2.0))
- (+ box-y (/ stroke 2.0))
- (- box-width stroke)
- (- box-height stroke)
- :fill background :rx (- radius (/ stroke 2.0)))
+ (when background
+ (svg-rectangle svg (+ box-x (/ stroke 2.0))
+ (+ box-y (/ stroke 2.0))
+ (- box-width stroke)
+ (- box-height stroke)
+ :fill background :rx (- radius (/ stroke 2.0))))
(dolist (item (xml-get-children (car root) 'path))
(let* ((attrs (xml-node-attributes item))