]> git.eshelyaron.com Git - emacs.git/commit
Shorten CSS hex colors when possible
authorSimen Heggestøyl <simenheg@gmail.com>
Sun, 28 Jan 2018 14:35:46 +0000 (15:35 +0100)
committerSimen Heggestøyl <simenheg@gmail.com>
Sun, 28 Jan 2018 14:38:27 +0000 (15:38 +0100)
commit69a30e8b87fac5888daa26c63663351570e3d533
treef7c4b0a665556c86dcaa4e744f1693bda393375c
parent97defdfc36d9a83a3081c5f76e249f908645f7ec
Shorten CSS hex colors when possible

* lisp/textmodes/css-mode.el (css--format-hex): New function for
shortening CSS hex colors when possible.
(css--named-color-to-hex, css--rgb-to-named-color-or-hex): Use it.

* test/lisp/textmodes/css-mode-tests.el (css-test-format-hex): New
tests for 'css--format-hex'.
(css-test-named-color-to-hex, css-test-cycle-color-format): Adjust for
the changes to 'css--named-color-to-hex' and
'css--rgb-to-named-color-or-hex'.
lisp/textmodes/css-mode.el
test/lisp/textmodes/css-mode-tests.el