summaryrefslogtreecommitdiff
path: root/src/dispextern.h
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-06-12 18:12:37 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2020-06-21 21:22:26 +0200
commit9fe2bdb88a4ebd4b2286c1c2a2a2ba7411af01b6 (patch)
tree0979ec4f38172e25a0420eca5b22650c249a80f4 /src/dispextern.h
parent0792f8e4f0de2328c57d552a5845bdf77265a971 (diff)
downloademacs-9fe2bdb88a4ebd4b2286c1c2a2a2ba7411af01b6.tar.gz
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.
Diffstat (limited to 'src/dispextern.h')
-rw-r--r--src/dispextern.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 0b1f3d14aeb..e1d6eddc419 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3514,6 +3514,8 @@ void update_face_from_frame_parameter (struct frame *, Lisp_Object,
Lisp_Object);
extern bool tty_defined_color (struct frame *, const char *, Emacs_Color *,
bool, bool);
+bool parse_color_spec (const char *,
+ unsigned short *, unsigned short *, unsigned short *);
Lisp_Object tty_color_name (struct frame *, int);
void clear_face_cache (bool);