• Mattias Engdegård's avatar
    Consolidate #RGB string parsers · 9fe2bdb8
    Mattias Engdegård authored
    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
    (HEX_COLOR_NAME_LENGTH): Remove #define.
nsterm.m 295 KB