Function: indent-bars--main-color

indent-bars--main-color is a natively compiled function defined in indent-bars.el.

Signature

(indent-bars--main-color STYLE &optional TINT TINT-BLEND BLEND-OVERRIDE)

Documentation

Calculate the main bar color for STYLE.

Uses indent-bars-color for color and background blend config. If TINT and TINT-BLEND are passed, first blend the TINT color into the main color with the requested blend, prior to blending into the background color. If BLEND-OVERRIDE is set, use it instead of the :blend factor in indent-bars-color.

Source Code

;; Defined in /nix/store/zkcdcnmcj3605fj09x584bf58d85brax-emacs-packages-deps/share/emacs/site-lisp/elpa/indent-bars-1.0.1/indent-bars.el
;;;;; Colors
(defun indent-bars--main-color (style &optional tint tint-blend blend-override)
  "Calculate the main bar color for STYLE.
Uses `indent-bars-color' for color and background blend config.
If TINT and TINT-BLEND are passed, first blend the TINT color
into the main color with the requested blend, prior to blending
into the background color.  If BLEND-OVERRIDE is set, use it
instead of the :blend factor in `indent-bars-color'."
  (cl-destructuring-bind (main &key face-bg blend) (indent-bars--style style "color")
    (let ((col (cond ((facep main)
		      (funcall (if face-bg #'face-background #'face-foreground)
			       main nil 'default))
		     ((color-defined-p main) main)))
	  (blend (or blend-override blend)))
      (when (string-prefix-p "unspecified-" col)
	(setq col (if face-bg
		      indent-bars-unspecified-bg-color
		    indent-bars-unspecified-fg-color)))
      (if (and tint tint-blend (color-defined-p tint)) ;tint main color
	  (setq col (indent-bars--blend-colors tint col tint-blend)))
      (if blend				;now blend into BG
	  (setq col (indent-bars--blend-colors
		     col (indent-bars--background) blend)))
      col)))