dev_theme.txt 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. *dev_theme.txt* Nvim
  2. NVIM REFERENCE MANUAL
  3. Nvim colorscheme guidelines *dev-theme*
  4. Style guidelines for developing Nvim's default colorscheme.
  5. License: CC-By 3.0 https://creativecommons.org/licenses/by/3.0/
  6. Type |gO| to see the table of contents.
  7. ==============================================================================
  8. Design
  9. - Be "Neovim branded", i.e. have mostly "green-blue" feel plus one or two
  10. colors reserved for very occasional user attention.
  11. - Be oriented for 'termguicolors' (true colors) while being extra minimal for
  12. 'notermguicolors' (16 colors) as fallback.
  13. - Be accessible, i.e. have high enough contrast ratio (as defined in
  14. https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef).
  15. This means to have value at least 7 for |hl-Normal| and 4.5 for some common
  16. cases (|hl-Visual|, `Comment` with set 'cursorline', colored syntax, `Diff*`,
  17. |hl-Search|).
  18. - Be suitable for dark and light backgrounds via exchange of dark and light
  19. palettes.
  20. - Be usable, i.e. provide enough visual feedback for common objects.
  21. ==============================================================================
  22. Palettes
  23. - There are two separate palettes: dark and light. They all contain the same
  24. set of colors exported as `NvimDark*` and `NvimLight*` colors respectively.
  25. - The dark palette is used for background in the dark color scheme and for
  26. foreground in the light color scheme; and vice versa. This introduces
  27. recognizable visual system without too standing out.
  28. - Actual computation of palettes should be done in a perceptually uniform
  29. color space. Oklch is a good choice.
  30. - Each palette has the following colors (descriptions are for dark background;
  31. reverse for light one):
  32. - Four shades of colored "cold" greys for general UI.
  33. - Dark ones (from darkest to lightest) are reserved as background for
  34. |hl-NormalFloat| (considered as "black"), |hl-Normal| (background),
  35. |hl-CursorLine|, |hl-Visual|.
  36. - Light ones (also from darkest to lightest) are reserved for
  37. `Comment`, |hl-StatusLine|/|hl-TabLine|, |hl-Normal| (foreground),
  38. and color considered as "white".
  39. - Six colors to provide enough terminal colors: red, yellow, green, cyan,
  40. blue, magenta.
  41. They should have (reasonably) similar lightness and chroma to make them
  42. visually coherent. Lightness should be as equal to the palette's basic grey
  43. (which is used for |hl-Normal|) as possible. They should have (reasonably)
  44. different hues to make them visually separable.
  45. - For 16 colors:
  46. - Greys are not used and are replaced with the foreground and background
  47. colors of the terminal emulator.
  48. - Non-grey colors fall back to terminal colors as ordered in ANSI codes
  49. (https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit),
  50. that is red (1, 9), green (2, 10), yellow (3, 11), blue (4, 12),
  51. magenta (5, 13), cyan (6, 14).
  52. To increase contrast, colors 1-6 are used for light background and 9-14
  53. for dark background.
  54. ==============================================================================
  55. Highlight groups
  56. Use:
  57. - Grey shades for general UI according to their design.
  58. - Bold text for keywords (`Statement` highlight group). This is an important
  59. choice to increase accessibility for people with color deficiencies, as it
  60. doesn't rely on actual color.
  61. - Green for strings, |hl-DiffAdd| (as background), |hl-DiagnosticOk|, and some
  62. minor text UI elements.
  63. - Cyan as main syntax color, i.e. for function usage (`Function` highlight
  64. group), |hl-DiffText|, |hl-DiagnosticInfo|, and some minor text UI elements.
  65. - Red to generally mean high user attention, i.e. errors; in particular for
  66. |hl-ErrorMsg|, |hl-DiffDelete|, |hl-DiagnosticError|.
  67. - Yellow very sparingly to mean mild user attention, i.e. warnings. That is,
  68. |hl-DiagnosticWarn| and |hl-WarningMsg|.
  69. - Blue very sparingly as |hl-DiagnosticHint| and some additional important
  70. syntax group (like `Identifier`).
  71. - Magenta very carefully (if at all).
  72. In case of 16 colors:
  73. - Rely on the assumption "Background color can be used as background; other
  74. colors can be used as foreground". This means that in any
  75. foreground/background combination there should be background and one
  76. non-background color.
  77. - Use 0 (black) or 15 (bright white) as foreground for non-grey background,
  78. depending on whether normal background is light or dark.
  79. vim:tw=78:ts=8:et:ft=help:norl: