Function: css--named-color

css--named-color is a byte-compiled function defined in css-mode.el.gz.

Signature

(css--named-color START-POINT STR)

Documentation

Check whether STR, seen at point, is CSS named color.

Returns STR if it is a valid color. Special care is taken to exclude some SCSS constructs.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/css-mode.el.gz
(defun css--named-color (start-point str)
  "Check whether STR, seen at point, is CSS named color.
Returns STR if it is a valid color.  Special care is taken
to exclude some SCSS constructs."
  (when-let* ((color (assoc str css--color-map)))
    (save-excursion
      (goto-char start-point)
      (forward-comment (- (point)))
      (skip-chars-backward "@[:alpha:]")
      (unless (looking-at-p "@\\(mixin\\|include\\)")
        (cdr color)))))