neovim/test/functional/api
Evgeni Chasnovski 64a14026d7
feat(highlight): update default color scheme
Problem: Default color scheme is suboptimal.

Solution: Start using new color scheme. Introduce new `vim` color scheme
for opt-in backward compatibility.

------
Main design ideas
- Be "Neovim branded".
- Be minimal for 256 colors with a bit more shades for true colors.
- Be accessible through high enough contrast ratios.
- Be suitable for dark and light backgrounds via exchange of dark and
  light palettes.

------
Palettes

- Have dark and light variants. Implemented through exporeted
  `NvimDark*` and `NvimLight*` hex colors.

- Palettes have 4 shades of grey for UI elements and 6 colors (red,
  yellow, green, cyan, blue, magenta).

- Actual values are computed procedurally in Oklch color space based on
  a handful of hyperparameters.

- Each color has a 256 colors variant with perceptually closest color.

------
Highlight groups

Use:

- Grey shades for general UI according to their design.

- Bold text for keywords (`Statement` highlight group). This is an
  important choice to increase accessibility for people with color
  deficiencies, as it doesn't rely on actual color.

- Green for strings, `DiffAdd` (as background), `DiagnosticOk`, and some
  minor text UI elements.

- Cyan as main syntax color, i.e. for function usage (`Function`
  highlight group), `DiffText`, `DiagnosticInfo`, and some minor text UI
  elements.

- Red to generally mean high user attention, i.e. errors; in particular
  for `ErrorMsg`, `DiffDelete`, `DiagnosticError`.

- Yellow very sparingly only with true colors to mean mild user
  attention, i.e. warnings. That is, `DiagnosticWarn` and `WarningMsg`.

- Blue very sparingly only with true colors as `DiagnosticHint` and some
  additional important syntax group (like `Identifier`).

- Magenta very carefully (if at all).

------
Notes

- To make tests work without relatively larege updates, each one is
  prepended with an equivalent of the call `:colorscheme vim`.

  Plus some tests which spawn new Neovim instances also now use 'vim'
  color scheme.

  In some cases tests are updated to fit new default color scheme.
2023-12-02 18:53:19 +02:00
..
autocmd_spec.lua docs: small fixes (#25585) 2023-10-29 16:02:32 +08:00
buffer_spec.lua fix(api): load buffer first on nvim_buf_set_lines (#25823) 2023-10-29 15:44:52 +08:00
buffer_updates_spec.lua refactor(defaults)!: change default 'commentstring' value to empty (#22862) 2023-04-02 23:01:48 +08:00
command_spec.lua fix(api): allow empty Lua table for nested dicts #22268 2023-02-16 07:07:18 -08:00
extmark_spec.lua feat(extmarks): add sign name to extmark "details" array 2023-11-22 12:43:59 +01:00
highlight_spec.lua feat(highlight): update default color scheme 2023-12-02 18:53:19 +02:00
keymap_spec.lua refactor: move some constants out of vim_defs.h (#26298) 2023-11-29 20:32:40 +08:00
menu_spec.lua tests/ui: remove unnecessary screen:detach() 2019-10-13 22:10:42 +02:00
proc_spec.lua refactor(api): consistent VALIDATE messages #22262 2023-02-14 11:19:28 -08:00
rpc_fixture.lua fix(tests): fixes for using vim.mpack and more ASAN 2023-02-10 20:19:04 +01:00
server_notifications_spec.lua test: unignore test which froze sourcehut (#25067) 2023-09-11 05:53:05 +08:00
server_requests_spec.lua refactor: move some constants out of vim_defs.h (#26298) 2023-11-29 20:32:40 +08:00
tabpage_spec.lua API: include invalid buffer/window/tabpage in error message (#11712) 2020-01-14 09:21:10 +01:00
ui_spec.lua docs: deprecate the "term_background" UI field 2023-11-13 19:04:47 -06:00
version_spec.lua feat: report "build" in vim.version() #23925 2023-06-11 14:57:23 -07:00
vim_spec.lua fix(api): use a conditional stack for nvim_cmd (#26341) 2023-12-01 13:56:04 +08:00
window_spec.lua fix(api): get virtual text with multiple hl properly (#25307) 2023-09-22 17:56:05 +08:00