diff options
| author | Pip Cet | 2019-07-22 02:40:35 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2019-07-27 14:05:46 +0300 |
| commit | 357399014acacc75bd1825fb2f498f1a4be7b362 (patch) | |
| tree | fbbfbca7fed181b564f5814c6941297e6f5f0372 /doc | |
| parent | e310843d9dc106187d0e45ef7f0b9cd90a881eec (diff) | |
| download | emacs-357399014acacc75bd1825fb2f498f1a4be7b362.tar.gz emacs-357399014acacc75bd1825fb2f498f1a4be7b362.zip | |
Use the CSS convention for #RGB colors (bug#36304)
* src/xterm.c (x_parse_color): Change interpretation of #RGB color
triplets to match CSS rather than X conventions.
* lisp/term/tty-colors.el (tty-color-standard-values): Change
interpretation of #RGB color triplets to match CSS rather than X
conventions. Allow upper-case digits. Fix rgb:R/G/B
interpretation.
* doc/emacs/display.texi (Colors): Specify the convention used for
"#RGB" color triplets.
* test/lisp/tty-colors-tests.el: New file.
* etc/NEWS: Mention the change.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/display.texi | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 0ce291335a9..8e842bea179 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -556,14 +556,14 @@ Font Lock mode. | |||
| 556 | 556 | ||
| 557 | @node Colors | 557 | @node Colors |
| 558 | @section Colors for Faces | 558 | @section Colors for Faces |
| 559 | @cindex color name | ||
| 560 | @cindex RGB triplet | ||
| 561 | 559 | ||
| 562 | Faces can have various foreground and background colors. When you | 560 | Faces can have various foreground and background colors. When you |
| 563 | specify a color for a face---for instance, when customizing the face | 561 | specify a color for a face---for instance, when customizing the face |
| 564 | (@pxref{Face Customization})---you can use either a @dfn{color name} | 562 | (@pxref{Face Customization})---you can use either a @dfn{color name} |
| 565 | or an @dfn{RGB triplet}. | 563 | or an @dfn{RGB triplet}. |
| 566 | 564 | ||
| 565 | @subsection Color Names | ||
| 566 | @cindex color name | ||
| 567 | @findex list-colors-display | 567 | @findex list-colors-display |
| 568 | @vindex list-colors-sort | 568 | @vindex list-colors-sort |
| 569 | A color name is a pre-defined name, such as @samp{dark orange} or | 569 | A color name is a pre-defined name, such as @samp{dark orange} or |
| @@ -578,12 +578,16 @@ such terminals. However, Emacs understands X11 color names even on | |||
| 578 | text terminals; if a face is given a color specified by an X11 color | 578 | text terminals; if a face is given a color specified by an X11 color |
| 579 | name, it is displayed using the closest-matching terminal color. | 579 | name, it is displayed using the closest-matching terminal color. |
| 580 | 580 | ||
| 581 | @subsection RGB Triplets | ||
| 582 | @cindex RGB triplet | ||
| 581 | An RGB triplet is a string of the form @samp{#RRGGBB}. Each of the | 583 | An RGB triplet is a string of the form @samp{#RRGGBB}. Each of the |
| 582 | R, G, and B components is a hexadecimal number specifying the | 584 | primary color components is represented by a hexadecimal number |
| 583 | component's relative intensity, one to four digits long (usually two | 585 | between @samp{00} (intensity 0) and @samp{FF} (the maximum intensity). |
| 584 | digits are used). The components must have the same number of digits. | 586 | It is also possible to use one, three, or four hex digits for each |
| 585 | For hexadecimal values A to F, either upper or lower case are | 587 | component, so @samp{red} can be represented as @samp{#F00}, |
| 586 | acceptable. | 588 | @samp{#fff000000}, or @samp{#ffff00000000}. The components must have |
| 589 | the same number of digits. For hexadecimal values A to F, either | ||
| 590 | upper or lower case are acceptable. | ||
| 587 | 591 | ||
| 588 | The @kbd{M-x list-colors-display} command also shows the equivalent | 592 | The @kbd{M-x list-colors-display} command also shows the equivalent |
| 589 | RGB triplet for each named color. For instance, @samp{medium sea | 593 | RGB triplet for each named color. For instance, @samp{medium sea |