Function: preview-dvipng-color-string

preview-dvipng-color-string is a byte-compiled function defined in preview.el.

Signature

(preview-dvipng-color-string COLORS RES)

Documentation

Return color setup tokens for dvipng.

Makes a string of options suitable for passing to dvipng. Pure borderless black-on-white will return an empty string.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/preview.el
(defun preview-dvipng-color-string (colors res)
  "Return color setup tokens for dvipng.
Makes a string of options suitable for passing to dvipng.
Pure borderless black-on-white will return an empty string."
  (let
      ((bg (aref colors 0))
       (fg (aref colors 1))
       (mask (aref colors 2))
       (border (aref colors 3)))
    (concat
     (and bg
          (format "--bg \"rgb %s\" "
                  (mapconcat #'preview-gs-color-value bg " ")))
     (and fg
          (format "--fg \"rgb %s\" "
                  (mapconcat #'preview-gs-color-value fg " ")))
     (and mask border
          (format "--bd \"rgb %s\" "
                  (mapconcat #'preview-gs-color-value mask " ")))
     (and border
          (format "--bd %d" (max 1 (round (/ (* res border) 72.0))))))))