Created
October 13, 2009 10:11
-
-
Save gregnewman/209130 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Display CSS Hexadecimal color values | |
| ; as background to that value. | |
| (defvar hexcolour-keywords | |
| '(("#[abcdef[:digit:]]\\{6\\}" | |
| (0 (put-text-property | |
| (match-beginning 0) | |
| (match-end 0) | |
| 'face (list :background | |
| (match-string-no-properties 0))))))) | |
| (defun hexcolour-add-to-font-lock () | |
| (font-lock-add-keywords nil hexcolour-keywords)) | |
| (add-hook 'css-mode-hook 'hexcolour-add-to-font-lock) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment