]> git.eshelyaron.com Git - emacs.git/commit
Consolidate #RGB string parsers
authorMattias Engdegård <mattiase@acm.org>
Fri, 12 Jun 2020 16:12:37 +0000 (18:12 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sun, 21 Jun 2020 19:22:26 +0000 (21:22 +0200)
commit9fe2bdb88a4ebd4b2286c1c2a2a2ba7411af01b6
tree0979ec4f38172e25a0420eca5b22650c249a80f4
parent0792f8e4f0de2328c57d552a5845bdf77265a971
Consolidate #RGB string parsers

Use a single parser of color strings in the #RGB, rgb:R/G/B and
rgbi:R/G/B formats, replacing four existing ones.  Previously,
error-checking was spotty, handling of the rgbi: format not always
present, and normalization of the result was sometimes incorrect.

* src/dispextern.h: New prototype.
* src/xfaces.c (parse_hex_color_comp, parse_float_color_comp)
(parse_color_spec, Finternal-color_values_from_color_spec): New functions.
* test/src/xfaces-tests.el (xfaces-internal-color-values-from-color-spec):
New test.
* lisp/term/tty-colors.el (tty-color-standard-values):
Use internal-color-values-from-color-spec, replacing old parser.
* src/nsterm.m (ns_get_color):
* src/w32fns.c (x_to_w32_color):
* src/xterm.c (x_parse_color): Use parse_color_spec, replacing old
parsers.
(HEX_COLOR_NAME_LENGTH): Remove #define.
lisp/term/tty-colors.el
src/dispextern.h
src/nsterm.m
src/w32fns.c
src/xfaces.c
src/xterm.c
test/src/xfaces-tests.el