Skip to content

Commit

Permalink
Add support for more OSC color formats (#7578)
Browse files Browse the repository at this point in the history
* Correct the behaviour of parsing `rgb:R/G/B`. It should be interpreted
  as `RR/GG/BB` instead of `0R/0G/0B`
* Add support for `rgb:RRR/GGG/BBB` and `rgb:RRRR/GGGG/BBBB`. The
  behaviour of 12 bit variants is to repeat the first digit at the end,
  e.g. `rgb:123/456/789` becomes `rgb:1231/4564/7897`.
* Add support for `#` formats. We are following the rules of
  [XParseColor] by interpreting `#RGB` as `R000G000B000`.
* Add support for XOrg app color names, which are supported by xterm, VTE
  and many other terminal emulators.
* Multi-parameter OSC 4 is now supported.
* The chaining of OSC 10-12 is not yet supported. But the parameter
  validation is relaxed by parsing the parameters as multi-params but
  only use the first one, which means `\e]10;rgb:R/G/B;` and
  `\e]10:rgb:R/G/B;invalid` will execute `OSC 10` with the first color
  correctly. This fixes some of the issues mentioned in #942 but not
  all of them.

[XParseColor]: https://linux.die.net/man/3/xparsecolor

Closes #3715
  • Loading branch information
skyline75489 authored Oct 15, 2020
1 parent f86045e commit 02b1202
Show file tree
Hide file tree
Showing 22 changed files with 2,831 additions and 623 deletions.
1 change: 1 addition & 0 deletions .github/actions/spell-check/dictionary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ it'll be accepted).
| [Microsoft](microsoft.txt) | Microsoft brand items |
| [Fonts](fonts.txt) | Font names |
| [Names](names.txt) | Names of people |
| [Colors](colors.txt) | Names of color |
1 change: 1 addition & 0 deletions .github/actions/spell-check/dictionary/apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ userenv
wcstoui
XDocument
XElement
XParse
Loading

0 comments on commit 02b1202

Please sign in to comment.