Subject: bug#2773: feature request: option for css mode to
highlight #rrggbb text
this is a feature request, for a option for css mode to highlight
in CSS, there are lots of RGB values, e.g.
it is very convenient if the rgb code can be colored by its value, so
that users can visually see what color they represent.
the css-mode that comes with emacs 22 doesn't seems to support this
feature. (doesn't seem to have customize-group support)
Here's a implementation that i've been using for a few months.
;; by Nikolaj Schumacher. http://www.emacswiki.org/emacs/HexColour
'face (list :background
(defun hexcolor-add-to-font-lock ()
(font-lock-add-keywords nil hexcolor-keywords))
(add-hook 'css-mode-hook 'hexcolor-add-to-font-lock)
Note: CSS spec also allows this short form #RGB, where each of the
rgb is a single char. e.g. #f3c is the same as #ff33cc. The above
code need a bit tweak for this case.
In GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0)
of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp