diff options
| -rw-r--r-- | lisp/textmodes/css-mode.el | 2 | ||||
| -rw-r--r-- | test/lisp/textmodes/css-mode-tests.el | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 6bd08f59190..135c0d5f928 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el | |||
| @@ -1458,7 +1458,7 @@ should not be mixed with those in color.el." | |||
| 1458 | (if-let* ((alpha (css--hex-alpha hex)) | 1458 | (if-let* ((alpha (css--hex-alpha hex)) |
| 1459 | (a (css--format-rgba-alpha | 1459 | (a (css--format-rgba-alpha |
| 1460 | (/ (string-to-number alpha 16) | 1460 | (/ (string-to-number alpha 16) |
| 1461 | (float (expt 16 (length alpha))))))) | 1461 | (float (- (expt 16 (length alpha)) 1)))))) |
| 1462 | (format "rgba(%d, %d, %d, %s)" r g b a) | 1462 | (format "rgba(%d, %d, %d, %s)" r g b a) |
| 1463 | (format "rgb(%d, %d, %d)" r g b)) | 1463 | (format "rgb(%d, %d, %d)" r g b)) |
| 1464 | t)) | 1464 | t)) |
diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el index 272d281217e..4883123843d 100644 --- a/test/lisp/textmodes/css-mode-tests.el +++ b/test/lisp/textmodes/css-mode-tests.el | |||
| @@ -281,7 +281,9 @@ | |||
| 281 | ("#fff" "rgb(255, 255, 255)") | 281 | ("#fff" "rgb(255, 255, 255)") |
| 282 | ("#ffffff" "rgb(255, 255, 255)") | 282 | ("#ffffff" "rgb(255, 255, 255)") |
| 283 | ("#ffffff80" "rgba(255, 255, 255, 0.5)") | 283 | ("#ffffff80" "rgba(255, 255, 255, 0.5)") |
| 284 | ("#fff8" "rgba(255, 255, 255, 0.5)"))) | 284 | ("#fff0" "rgba(255, 255, 255, 0)") |
| 285 | ("#fff8" "rgba(255, 255, 255, 0.53)") | ||
| 286 | ("#ffff" "rgba(255, 255, 255, 1)"))) | ||
| 285 | (with-temp-buffer | 287 | (with-temp-buffer |
| 286 | (css-mode) | 288 | (css-mode) |
| 287 | (insert (nth 0 item)) | 289 | (insert (nth 0 item)) |