branch: elpa/htmlize commit e390792b84aa61df29f899de118a8d93baf421b0 Author: Ihor Radchenko <yanta...@posteo.net> Commit: Ihor Radchenko <yanta...@posteo.net>
htmlize-color-to-rgb: Use Emacs to convert non-standard #... colors * htmlize.el (htmlize-color-to-rgb): Only leave #XXXXXX color hashes as is. Use rgb.txt or `color-values' to obtain appropriate #XXXXXX hash for non-standard colors (e.g. #rrrrggggbbbb or #AAA). Alternative fix for #30. --- htmlize.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htmlize.el b/htmlize.el index bdca9aacd8..784702f870 100644 --- a/htmlize.el +++ b/htmlize.el @@ -949,7 +949,7 @@ If no rgb.txt file is found, return nil." ;; specifying any color. Hence (htmlize-color-to-rgb nil) ;; returns nil. ) - ((string-match "\\`#" color) + ((string-match "\\`#[0-9a-fA-F]\\{6\\}" color) ;; The color is already in #rrggbb format. (setq rgb-string color)) ((and htmlize-use-rgb-txt