Skip to content

Commit

Permalink
fix minor issue in how colors are calculated for export
Browse files Browse the repository at this point in the history
  • Loading branch information
jkitchin committed Oct 3, 2021
1 parent ee827f9 commit 7281701
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scimax-editmarks.org
Expand Up @@ -727,13 +727,14 @@ we go with the font color."
(fg-color (or (plist-get (get-text-property (point) 'face) :foreground) "black"))
(bg-color (plist-get (get-text-property (point) 'face) :background))
(fg-rgb (color-name-to-rgb fg-color))
(fg-hex (apply 'color-rgb-to-hex fg-rgb))
;; the append (2) makes it use 24-bit color I think
(fg-hex (apply 'color-rgb-to-hex (append fg-rgb '(2))))
bg-rgb
;; this is white
(bg-hex "#ffffff"))
(when bg-color
(setq bg-rgb (color-name-to-rgb bg-color)
bg-hex (apply 'color-rgb-to-hex bg-rgb)))
bg-hex (apply 'color-rgb-to-hex (append bg-rgb '(2)))))

(cond
((eq 'latex backend)
Expand Down Expand Up @@ -763,12 +764,12 @@ we go with the font color."
(mapconcat
(lambda (s)
(format "@@html:<span style=\"color: %s; background-color: %s\">%s</span>@@"
fg-hex bg-hex s))
fg-hex
bg-hex
s))
(s-split "\n" (buffer-substring-no-properties (car content-bounds)
(cdr content-bounds)))
"@@html:<br>@@"))))))


#+END_SRC

#+RESULTS:
Expand Down

0 comments on commit 7281701

Please sign in to comment.