In css-mode color strings get a background color corresponding to the respective color - like this (image):


How to achieve this behaviour in other modes?

1 Answer 1


OK… wasn't aware of rainbow-mode, wich does exactly, what I intended. Of cource I found it after I posted question here ^^.

So the solution is:

M-x package-install RET rainbow-mode RET

To answer my question completely and enable it in all modes: I added

(define-globalized-minor-mode global-rainbow-mode rainbow-mode (lambda () (rainbow-mode 1)))

(global-rainbow-mode 1)

to my init file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.