Function: preview-gs-color-string

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

Signature

(preview-gs-color-string COLORS &optional SUPPRESS-FGBG)

Documentation

Return a string setting up COLORS.

If optional argument SUPPRESS-FGBG is non-nil, behave as if FG/BG colors were just the default value.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/preview.el
(defun preview-gs-color-string (colors &optional suppress-fgbg)
  "Return a string setting up COLORS.
If optional argument SUPPRESS-FGBG is non-nil, behave as if FG/BG
colors were just the default value."
  (let ((bg (and (not suppress-fgbg)
                 (aref colors 0)))
        (fg (and (not suppress-fgbg)
                 (aref colors 1)))
        (mask (aref colors 2))
        (border (aref colors 3)))
    (concat
     (and (or (and mask border) (and bg (not fg)))
          "gsave ")
     (and bg
         (concat
          (mapconcat #'preview-gs-color-value bg " ")
          " setrgbcolor clippath fill "))
     (and mask border
         (format "%s setrgbcolor false setstrokeadjust %g \
setlinewidth clippath strokepath \
matrix setmatrix true \
{2 index{newpath}if round exch round exch moveto pop false}\
{round exch round exch lineto}{curveto}{closepath}\
pathforall pop fill "
                 (mapconcat #'preview-gs-color-value mask " ")
                 (* 2 border)))
          ;; I hate antialiasing.  Warp border to integral coordinates.
     (and (or (and mask border) (and bg (not fg)))
          "grestore ")
     (and fg
          (concat
           (mapconcat #'preview-gs-color-value fg " ")
           " setrgbcolor")))))