├── LICENSE ├── README.md └── colors ├── dichromatic.vim └── dichromatic.erb /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Romain Lafourcade 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dichromatic 2 | 3 | A dark color scheme for color blind vimmers, but not only. 4 | 5 | --- 6 | 7 | Humans are capable of perceiving a relatively large color spectrum thanks to special receptors in our retina called *cones*. Most of us have three types of cones to take care of the different wavelengths that compose visible light. That's called *trichromia*, it's the norm and most Vim color schemes are designed against that norm. 8 | 9 | Some of us — as much as 8% of the male population in some parts of the world — have a missing or damaged cone, however, which prevents them from perceiving some colors. That condition is called *dichromia* or, coloquially, color blindness. 10 | 11 | Color blindness comes in many forms, depending on what cones are missing or damaged or even if we are talking *rods*, but the end result is always the same: the person gets confused pretty easily when colors are too close to each other or fall into one of their blind spots or if there's not enough contrast. If that wasn't enough, dichromia itself comes in three forms: *protanopia*, *deuteranopia* and *tritanopia* which have varying effects. Choosing the right colors is a difficult task when designing for "normal" vision but it should be apparent by now that designing for color blind users is at another level entirely. 12 | 13 | Here is a screenshot of another color scheme of mine illustrating the problem: 14 | 15 | Normal vision: 16 | 17 | ![Normal vision](http://romainl.github.io/vim-dichromatic/images/apprentice-normal-vision.png) 18 | 19 | Tritanopia: 20 | 21 | ![Tritanopia](http://romainl.github.io/vim-dichromatic/images/apprentice-tritanopia.png) 22 | 23 | The colors in Apprentice are nice and all for us "normals" but they are obviously less than optimal for someone with, say… tritanopia. The problem is not limited to Vim, of course: maps, charts, traffic lights and all kinds of information systems are routinely designed without any thought for dichromia but that shouldn't be a comforting thought. We can do better. 24 | 25 | Thankfully, researchers across the world have been busy designing color palettes suitable for *anybody*, color blind or not. [One such effort](https://personal.sron.nl/~pault/) produced the palette I used as a basis for Dichromatic: 26 | 27 | ![SRON palette](http://romainl.github.io/vim-dichromatic/images/sron-palette.png) 28 | 29 | The image below shows the "final" palette used in Dichromatic, slightly modified from the colors above to fit in the standard [xterm palette](https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg). 30 | 31 | ![Dichromatic palette](http://romainl.github.io/vim-dichromatic/images/palette.png) 32 | 33 | And here are screenshots of dichomatic, first without filter, for color blind users to form their opinion, then with various filters applied, for users with normal vision to get an idea of how color blind users may see it: 34 | 35 | Normal vision: 36 | 37 | ![Normal vision](http://romainl.github.io/vim-dichromatic/images/dichromatic-normal-vision.png) 38 | 39 | Deuteranopia (common): 40 | 41 | ![Deuteranopia](http://romainl.github.io/vim-dichromatic/images/dichromatic-deuteranopia.png) 42 | 43 | Protanopia (rare): 44 | 45 | ![Protanopia](http://romainl.github.io/vim-dichromatic/images/dichromatic-protanopia.png) 46 | 47 | Tritanopia (very rare): 48 | 49 | ![Tritanopia](http://romainl.github.io/vim-dichromatic/images/dichromatic-tritanopia.png) 50 | 51 | ## Configuration 52 | 53 | This color scheme is pretty much compatible with any reasonably recent Vim executed in any correctly set-up environment. "Compatible" in the sense that it will not break anything but it is only guaranteed to work the way it's supposed to work in GUI Vim (GVim, MacVim) and in TUI Vim *in 256color-ready terminal emulators*. 8color-ready and 16color-ready terminal emulators are not directly supported at the moment but they may. Stay tuned. 54 | 55 | ### GVim/MacVim 56 | 57 | GUI Vim is pretty much the bee's knees, color scheme-wise, so there's nothing to do here. 58 | 59 | ### 256 colors terminal emulators 60 | 61 | Make sure your terminal emulator correctly tells Vim that it is capable of displaying 256 colors. It is usually done by setting the `TERM` environment variable to something like `xterm-256color` or `screen-256color`. How to do that depends on your terminal emulator so you should read its documentation if you are unsure about the exact method. 62 | 63 | ## Installation 64 | 65 | Use your favorite plugin manager or drop `dichromatic.vim` into: 66 | 67 | $HOME/.vim/colors/ on unix-like systems 68 | %userprofile%\vimfiles\colors\ on Windows 69 | 70 | ## Usage 71 | 72 | Make sure you have *either* of the following lines in your `vimrc`: 73 | 74 | syntax on 75 | syntax enable 76 | 77 | Add the line below somewhere near the end of the file: 78 | 79 | colorscheme dichromatic 80 | 81 | ## Hacking 82 | 83 | The heavily commented template used for the creation of Dichromatic is available in the `colors/` directory. Feel free to play with it and send pull requests. 84 | 85 | ## Reference 86 | 87 | * http://jfly.iam.u-tokyo.ac.jp/color/ 88 | * https://personal.sron.nl/~pault/ 89 | * http://www.somersault1824.com/tips-for-designing-scientific-figures-for-color-blind-readers/ 90 | * http://www.iamcal.com/toys/colors/ 91 | * https://en.wikipedia.org/wiki/Color_blindness 92 | -------------------------------------------------------------------------------- /colors/dichromatic.vim: -------------------------------------------------------------------------------- 1 | " dichromatic.vim -- Vim color scheme. 2 | " Author: Romain Lafourcade (romainlafourcade@gmail.com) 3 | " Webpage: http://www.example.com 4 | " Description: A 'dark' colorscheme for color blind vimmers. But not only. 5 | 6 | hi clear 7 | 8 | if exists("syntax_on") 9 | syntax reset 10 | endif 11 | 12 | let colors_name = "dichromatic" 13 | 14 | if ($TERM =~ '256' || &t_Co >= 256) || has("gui_running") 15 | hi Normal ctermbg=232 ctermfg=252 cterm=NONE guibg=#080808 guifg=#D0D0D0 gui=NONE 16 | hi NonText ctermbg=NONE ctermfg=240 cterm=NONE guibg=NONE guifg=#585858 gui=NONE 17 | hi Comment ctermbg=NONE ctermfg=244 cterm=NONE guibg=NONE guifg=#808080 gui=NONE 18 | hi Constant ctermbg=NONE ctermfg=168 cterm=NONE guibg=NONE guifg=#D75F87 gui=NONE 19 | hi Error ctermbg=15 ctermfg=89 cterm=reverse guibg=#FFFFFF guifg=#87005F gui=reverse 20 | hi Identifier ctermbg=NONE ctermfg=133 cterm=NONE guibg=NONE guifg=#AF5FAF gui=NONE 21 | hi Ignore ctermbg=NONE ctermfg=NONE cterm=NONE guibg=NONE guifg=NONE gui=NONE 22 | hi PreProc ctermbg=NONE ctermfg=186 cterm=NONE guibg=NONE guifg=#DFDF87 gui=NONE 23 | hi Special ctermbg=NONE ctermfg=15 cterm=NONE guibg=NONE guifg=#FFFFFF gui=NONE 24 | hi Statement ctermbg=NONE ctermfg=133 cterm=NONE guibg=NONE guifg=#AF5FAF gui=NONE 25 | hi String ctermbg=NONE ctermfg=142 cterm=NONE guibg=NONE guifg=#AFAF00 gui=NONE 26 | hi Todo ctermbg=NONE ctermfg=NONE cterm=reverse guibg=NONE guifg=NONE gui=reverse 27 | hi Type ctermbg=NONE ctermfg=116 cterm=NONE guibg=NONE guifg=#87D7D7 gui=NONE 28 | hi Underlined ctermbg=NONE ctermfg=NONE cterm=underline guibg=NONE guifg=NONE gui=underline 29 | hi Number ctermbg=NONE ctermfg=168 cterm=NONE guibg=NONE guifg=#D75F87 gui=NONE 30 | hi StatusLine ctermbg=15 ctermfg=240 cterm=NONE guibg=#FFFFFF guifg=#585858 gui=NONE 31 | hi StatusLineNC ctermbg=240 ctermfg=15 cterm=NONE guibg=#585858 guifg=#FFFFFF gui=NONE 32 | hi VertSplit ctermbg=240 ctermfg=240 cterm=NONE guibg=#585858 guifg=#585858 gui=NONE 33 | hi TabLine ctermbg=240 ctermfg=15 cterm=NONE guibg=#585858 guifg=#FFFFFF gui=NONE 34 | hi TabLineFill ctermbg=240 ctermfg=240 cterm=NONE guibg=#585858 guifg=#585858 gui=NONE 35 | hi TabLineSel ctermbg=15 ctermfg=240 cterm=NONE guibg=#FFFFFF guifg=#585858 gui=NONE 36 | hi Title ctermbg=NONE ctermfg=72 cterm=NONE guibg=NONE guifg=#5FAF87 gui=NONE 37 | hi LineNr ctermbg=NONE ctermfg=116 cterm=NONE guibg=NONE guifg=#87D7D7 gui=NONE 38 | hi Cursor ctermbg=15 ctermfg=232 cterm=NONE guibg=#FFFFFF guifg=#080808 gui=NONE 39 | hi CursorColumn ctermbg=89 ctermfg=NONE cterm=NONE guibg=#87005F guifg=NONE gui=NONE 40 | hi CursorLine ctermbg=236 ctermfg=NONE cterm=NONE guibg=#303030 guifg=NONE gui=NONE 41 | hi CursorLineNr ctermbg=236 ctermfg=NONE cterm=NONE guibg=#303030 guifg=NONE gui=NONE 42 | hi helpLeadBlank ctermbg=NONE ctermfg=NONE cterm=NONE guibg=NONE guifg=NONE gui=NONE 43 | hi helpNormal ctermbg=NONE ctermfg=NONE cterm=NONE guibg=NONE guifg=NONE gui=NONE 44 | hi Visual ctermbg=116 ctermfg=232 cterm=NONE guibg=#87D7D7 guifg=#080808 gui=NONE 45 | hi VisualNOS ctermbg=133 ctermfg=232 cterm=NONE guibg=#AF5FAF guifg=#080808 gui=NONE 46 | hi Pmenu ctermbg=186 ctermfg=232 cterm=NONE guibg=#DFDF87 guifg=#080808 gui=NONE 47 | hi PmenuSbar ctermbg=142 ctermfg=186 cterm=NONE guibg=#AFAF00 guifg=#DFDF87 gui=NONE 48 | hi PmenuSel ctermbg=133 ctermfg=232 cterm=NONE guibg=#AF5FAF guifg=#080808 gui=NONE 49 | hi PmenuThumb ctermbg=133 ctermfg=133 cterm=NONE guibg=#AF5FAF guifg=#AF5FAF gui=NONE 50 | hi FoldColumn ctermbg=NONE ctermfg=72 cterm=NONE guibg=NONE guifg=#5FAF87 gui=NONE 51 | hi Folded ctermbg=NONE ctermfg=248 cterm=NONE guibg=NONE guifg=#A8A8A8 gui=NONE 52 | hi WildMenu ctermbg=53 ctermfg=15 cterm=NONE guibg=#00005F guifg=#FFFFFF gui=NONE 53 | hi SpecialKey ctermbg=NONE ctermfg=186 cterm=NONE guibg=NONE guifg=#DFDF87 gui=NONE 54 | hi DiffAdd ctermbg=232 ctermfg=111 cterm=reverse guibg=#080808 guifg=#87afff gui=reverse 55 | hi DiffChange ctermbg=232 ctermfg=188 cterm=reverse guibg=#080808 guifg=#dfdfdf gui=reverse 56 | hi DiffDelete ctermbg=232 ctermfg=222 cterm=reverse guibg=#080808 guifg=#ffdf87 gui=reverse 57 | hi DiffText ctermbg=232 ctermfg=145 cterm=reverse guibg=#080808 guifg=#afafaf gui=reverse 58 | hi IncSearch ctermbg=232 ctermfg=133 cterm=reverse guibg=#080808 guifg=#AF5FAF gui=reverse 59 | hi Search ctermbg=186 ctermfg=232 cterm=NONE guibg=#DFDF87 guifg=#080808 gui=NONE 60 | hi Directory ctermbg=NONE ctermfg=72 cterm=NONE guibg=NONE guifg=#5FAF87 gui=NONE 61 | hi MatchParen ctermbg=240 ctermfg=186 cterm=NONE guibg=#585858 guifg=#DFDF87 gui=NONE 62 | hi SpellBad ctermbg=89 ctermfg=232 cterm=NONE guibg=#87005F guifg=#080808 gui=NONE guisp=#87005F 63 | hi SpellCap ctermbg=72 ctermfg=232 cterm=NONE guibg=#5FAF87 guifg=#080808 gui=NONE guisp=#5FAF87 64 | hi SpellLocal ctermbg=142 ctermfg=232 cterm=NONE guibg=#AFAF00 guifg=#080808 gui=NONE guisp=#AFAF00 65 | hi SpellRare ctermbg=133 ctermfg=232 cterm=NONE guibg=#AF5FAF guifg=#080808 gui=NONE guisp=#AF5FAF 66 | hi ColorColumn ctermbg=133 ctermfg=NONE cterm=NONE guibg=#AF5FAF guifg=NONE gui=NONE 67 | hi signColumn ctermbg=NONE ctermfg=186 cterm=NONE guibg=NONE guifg=#DFDF87 gui=NONE 68 | hi ErrorMsg ctermbg=89 ctermfg=15 cterm=NONE guibg=#87005F guifg=#FFFFFF gui=NONE 69 | hi ModeMsg ctermbg=142 ctermfg=232 cterm=NONE guibg=#AFAF00 guifg=#080808 gui=NONE 70 | hi MoreMsg ctermbg=NONE ctermfg=142 cterm=NONE guibg=NONE guifg=#AFAF00 gui=NONE 71 | hi Question ctermbg=NONE ctermfg=72 cterm=NONE guibg=NONE guifg=#5FAF87 gui=NONE 72 | hi WarningMsg ctermbg=168 ctermfg=232 cterm=NONE guibg=#D75F87 guifg=#080808 gui=NONE 73 | hi QuickFixLine ctermbg=15 ctermfg=240 cterm=NONE guibg=#FFFFFF guifg=#585858 gui=NONE 74 | 75 | elseif &t_Co == 8 || $TERM !~# '^linux' || &t_Co == 16 76 | set t_Co=16 77 | 78 | hi Normal ctermbg=black ctermfg=grey cterm=NONE 79 | hi NonText ctermbg=NONE ctermfg=darkgrey cterm=NONE 80 | hi Comment ctermbg=NONE ctermfg=darkgrey cterm=NONE 81 | hi Constant ctermbg=NONE ctermfg=red cterm=NONE 82 | hi Error ctermbg=white ctermfg=darkmagenta cterm=reverse 83 | hi Identifier ctermbg=NONE ctermfg=darkred cterm=NONE 84 | hi Ignore ctermbg=NONE ctermfg=NONE cterm=NONE 85 | hi PreProc ctermbg=NONE ctermfg=yellow cterm=NONE 86 | hi Special ctermbg=NONE ctermfg=white cterm=NONE 87 | hi Statement ctermbg=NONE ctermfg=darkred cterm=NONE 88 | hi String ctermbg=NONE ctermfg=darkyellow cterm=NONE 89 | hi Todo ctermbg=NONE ctermfg=NONE cterm=reverse 90 | hi Type ctermbg=NONE ctermfg=cyan cterm=NONE 91 | hi Underlined ctermbg=NONE ctermfg=NONE cterm=underline 92 | hi Number ctermbg=NONE ctermfg=red cterm=NONE 93 | hi StatusLine ctermbg=white ctermfg=darkgrey cterm=NONE 94 | hi StatusLineNC ctermbg=darkgrey ctermfg=white cterm=NONE 95 | hi VertSplit ctermbg=darkgrey ctermfg=darkgrey cterm=NONE 96 | hi TabLine ctermbg=darkgrey ctermfg=white cterm=NONE 97 | hi TabLineFill ctermbg=darkgrey ctermfg=darkgrey cterm=NONE 98 | hi TabLineSel ctermbg=white ctermfg=darkgrey cterm=NONE 99 | hi Title ctermbg=NONE ctermfg=green cterm=NONE 100 | hi LineNr ctermbg=NONE ctermfg=cyan cterm=NONE 101 | hi Cursor ctermbg=white ctermfg=black cterm=NONE 102 | hi CursorColumn ctermbg=darkmagenta ctermfg=NONE cterm=NONE 103 | hi CursorLine ctermbg=black ctermfg=NONE cterm=NONE 104 | hi CursorLineNr ctermbg=black ctermfg=NONE cterm=NONE 105 | hi helpLeadBlank ctermbg=NONE ctermfg=NONE cterm=NONE 106 | hi helpNormal ctermbg=NONE ctermfg=NONE cterm=NONE 107 | hi Visual ctermbg=cyan ctermfg=black cterm=NONE 108 | hi VisualNOS ctermbg=darkred ctermfg=black cterm=NONE 109 | hi Pmenu ctermbg=yellow ctermfg=black cterm=NONE 110 | hi PmenuSbar ctermbg=darkyellow ctermfg=yellow cterm=NONE 111 | hi PmenuSel ctermbg=darkred ctermfg=black cterm=NONE 112 | hi PmenuThumb ctermbg=darkred ctermfg=darkred cterm=NONE 113 | hi FoldColumn ctermbg=NONE ctermfg=green cterm=NONE 114 | hi Folded ctermbg=NONE ctermfg=grey cterm=NONE 115 | hi WildMenu ctermbg=darkblue ctermfg=white cterm=NONE 116 | hi SpecialKey ctermbg=NONE ctermfg=yellow cterm=NONE 117 | hi DiffAdd ctermbg=black ctermfg=blue cterm=reverse 118 | hi DiffChange ctermbg=black ctermfg=grey cterm=reverse 119 | hi DiffDelete ctermbg=black ctermfg=yellow cterm=reverse 120 | hi DiffText ctermbg=black ctermfg=darkgray cterm=reverse 121 | hi IncSearch ctermbg=black ctermfg=darkred cterm=reverse 122 | hi Search ctermbg=yellow ctermfg=black cterm=NONE 123 | hi Directory ctermbg=NONE ctermfg=green cterm=NONE 124 | hi MatchParen ctermbg=darkgrey ctermfg=yellow cterm=NONE 125 | hi SpellBad ctermbg=darkmagenta ctermfg=black cterm=NONE 126 | hi SpellCap ctermbg=green ctermfg=black cterm=NONE 127 | hi SpellLocal ctermbg=darkyellow ctermfg=black cterm=NONE 128 | hi SpellRare ctermbg=darkred ctermfg=black cterm=NONE 129 | hi ColorColumn ctermbg=darkred ctermfg=NONE cterm=NONE 130 | hi signColumn ctermbg=NONE ctermfg=yellow cterm=NONE 131 | hi ErrorMsg ctermbg=darkmagenta ctermfg=white cterm=NONE 132 | hi ModeMsg ctermbg=darkyellow ctermfg=black cterm=NONE 133 | hi MoreMsg ctermbg=NONE ctermfg=darkyellow cterm=NONE 134 | hi Question ctermbg=NONE ctermfg=green cterm=NONE 135 | hi WarningMsg ctermbg=red ctermfg=black cterm=NONE 136 | hi QuickFixLine ctermbg=white ctermfg=darkgrey cterm=NONE 137 | endif 138 | 139 | hi link StatusLineTerm StatusLine 140 | hi link StatusLineTermNC StatusLineNC 141 | 142 | let g:terminal_ansi_colors = [ 143 | \ '#080808', 144 | \ '#AF5FAF', 145 | \ '#008700', 146 | \ '#AFAF00', 147 | \ '#00005F', 148 | \ '#87005F', 149 | \ '#87D7D7', 150 | \ '#D0D0D0', 151 | \ '#808080', 152 | \ '#D75F87', 153 | \ '#5FAF87', 154 | \ '#DFDF87', 155 | \ '#87D7D7', 156 | \ '#D75F87', 157 | \ '#87D7D7', 158 | \ '#FFFFFF', 159 | \ ] 160 | 161 | " Generated with RNB (https://gist.github.com/romainl/5cd2f4ec222805f49eca) 162 | -------------------------------------------------------------------------------- /colors/dichromatic.erb: -------------------------------------------------------------------------------- 1 | <% 2 | # RNB, A VIM COLORSCHEME TEMPLATE 3 | # Author: Romain Lafourcade (https://github.com/romainl) 4 | # Canonical URL: https://gist.github.com/romainl/5cd2f4ec222805f49eca 5 | 6 | # This template is designed to help vimmers create their own colorschemes 7 | # without much effort. 8 | # 9 | # You will need Ruby to generate your colorscheme but Ruby knowledge is 10 | # not needed at all. 11 | # 12 | # The process is divided in four steps: 13 | # 1. start by editing your colorscheme's information, 14 | # 2. define your colors, 15 | # 3. define your highlight groups and links, 16 | # 4. and generate your colorscheme. 17 | 18 | # Step 1: information 19 | # 20 | # Make sure the name of your colorscheme is unique and attractive. 21 | # The description should fit in a single line with no linefeed. 22 | information = { 23 | author: "Romain Lafourcade", 24 | email: "romainlafourcade@gmail.com", 25 | name: "dichromatic", 26 | description: "A 'dark' colorscheme for color blind vimmers. But not only.", 27 | webpage: "http://www.example.com" 28 | } 29 | 30 | # Step 2: colors 31 | # 32 | # black = [ give each color a distinctive name 33 | # "#000000", hexadecimal color used in GVim/MacVim 34 | # 0, integer between 0 and 255 used by terminals supporting 256 colors 35 | # "black" color name used by less capable color terminals, can be "darkred", 36 | # "red", "darkgreen", "green", "darkyellow", "yellow", "darkblue", 37 | # "blue", "darkmagenta", "magenta", "black", "darkgrey", "grey", 38 | # "white" 39 | # ] 40 | # 41 | # If your colors are defined correctly, the resulting colorscheme is guaranteed 42 | # to work in GVim (Windows/Linux), MacVim, and any properly set up terminal emulator. 43 | # 44 | # The colors below are the first 16 colors of the xterm palette. They 45 | # are only here as an example, though. You can get rid of them, I won't be mad. 46 | sky = ["#87D7D7", 116, "cyan"] 47 | teal = ["#5FAF87", 72, "green"] 48 | moss = ["#008700", 28, "darkgreen"] 49 | asparagus = ["#AFAF00", 142, "darkyellow"] 50 | cantaloupe = ["#DFDF87", 186, "yellow"] 51 | strawberry = ["#D75F87", 168, "red"] 52 | orchid = ["#AF5FAF", 133, "darkred"] 53 | rose = ["#87005F", 89, "darkmagenta"] 54 | eggplant = ["#00005F", 53, "darkblue"] 55 | white = ["#FFFFFF", 15, "white"] 56 | lightergray = ["#D0D0D0", 252, "grey"] 57 | lightgray = ["#A8A8A8", 248, "grey"] 58 | gray = ["#808080", 244, "darkgrey"] 59 | darkgray = ["#585858", 240, "darkgrey"] 60 | darkergray = ["#303030", 236, "black"] 61 | black = ["#080808", 232, "black"] 62 | DiffAdd = ["#87afff", 111, "blue"] 63 | DiffDelete = ["#ffdf87", 222, "yellow"] 64 | DiffChange = ["#dfdfdf", 188, "grey"] 65 | DiffText = ["#afafaf", 145, "darkgray"] 66 | 67 | # Step 3: highlights 68 | # 69 | # You can define highlight groups like this: 70 | # 71 | # [ "Normal", name of the highlight group 72 | # white, the color used for background color, or use "NONE", "fg" or "bg" 73 | # darkgray, the color used for foreground color, or use "NONE", "fg" or "bg" 74 | # "NONE" style, can be "bold", "underline", "reverse", "italic", 75 | # "standout", "NONE" or "undercurl" 76 | # ] 77 | # 78 | # The sample above tells Vim to render normal text in dark gray against a white 79 | # background, without any styling. 80 | # 81 | # or link an highlight group to another: 82 | # 83 | # [ "Title", "Normal" ] 84 | # 85 | # In GUI Vim, there is an additional color for the undercurl used to 86 | # highlight spelling mistakes: 87 | # 88 | # [ "SpellBad", name of the highlight group 89 | # "NONE", the color used for background color, or use "NONE", "fg" or "bg" 90 | # red, the color used for foreground color, or use "NONE", "fg" or "bg" 91 | # "undercurl", style 92 | # red color used for the undercurl 93 | # ] 94 | # 95 | # The sample above tells Vim to render badly spelled words in red against the current 96 | # background, with a red undercurl. 97 | # 98 | # You can add any custom highlight group to the standard list below but you shouldn't 99 | # remove any if you want a working colorscheme. 100 | highlights = [ 101 | [ "Normal", black, lightergray, "NONE" ], 102 | [ "NonText", "NONE", darkgray, "NONE" ], 103 | 104 | [ "Comment", "NONE", gray, "NONE" ], 105 | [ "Constant", "NONE", strawberry, "NONE" ], 106 | [ "Error", white, rose, "reverse" ], 107 | [ "Identifier", "NONE", orchid, "NONE" ], 108 | [ "Ignore", "NONE", "NONE", "NONE" ], 109 | [ "PreProc", "NONE", cantaloupe, "NONE" ], 110 | [ "Special", "NONE", white, "NONE" ], 111 | [ "Statement", "NONE", orchid, "NONE" ], 112 | [ "String", "NONE", asparagus, "NONE" ], 113 | [ "Todo", "NONE", "NONE", "reverse" ], 114 | [ "Type", "NONE", sky, "NONE" ], 115 | [ "Underlined", "NONE", "NONE", "underline" ], 116 | [ "Number", "NONE", strawberry , "NONE" ], 117 | 118 | [ "StatusLine", white, darkgray, "NONE" ], 119 | [ "StatusLineNC", darkgray, white, "NONE" ], 120 | [ "StatusLineTerm", "StatusLine" ], 121 | [ "StatusLineTermNC", "StatusLineNC" ], 122 | [ "VertSplit", darkgray, darkgray, "NONE" ], 123 | 124 | [ "TabLine", darkgray, white, "NONE" ], 125 | [ "TabLineFill", darkgray, darkgray, "NONE" ], 126 | [ "TabLineSel", white, darkgray, "NONE" ], 127 | 128 | [ "Title", "NONE", teal, "NONE" ], 129 | [ "LineNr", "NONE", sky, "NONE" ], 130 | 131 | [ "Cursor", white, black, "NONE" ], 132 | [ "CursorColumn", rose, "NONE", "NONE" ], 133 | [ "CursorLine", darkergray, "NONE", "NONE" ], 134 | [ "CursorLineNr", darkergray, "NONE", "NONE" ], 135 | 136 | [ "helpLeadBlank", "NONE", "NONE", "NONE" ], 137 | [ "helpNormal", "NONE", "NONE", "NONE" ], 138 | 139 | [ "Visual", sky, black, "NONE" ], 140 | [ "VisualNOS", orchid, black, "NONE" ], 141 | 142 | [ "Pmenu", cantaloupe, black, "NONE" ], 143 | [ "PmenuSbar", asparagus, cantaloupe, "NONE" ], 144 | [ "PmenuSel", orchid, black, "NONE" ], 145 | [ "PmenuThumb", orchid, orchid, "NONE" ], 146 | 147 | [ "FoldColumn", "NONE", teal, "NONE" ], 148 | [ "Folded", "NONE", lightgray, "NONE" ], 149 | 150 | [ "WildMenu", eggplant, white, "NONE" ], 151 | [ "SpecialKey", "NONE", cantaloupe, "NONE" ], 152 | 153 | [ "DiffAdd", black, DiffAdd, "reverse" ], 154 | [ "DiffChange", black, DiffChange, "reverse" ], 155 | [ "DiffDelete", black, DiffDelete, "reverse" ], 156 | [ "DiffText", black, DiffText, "reverse" ], 157 | 158 | [ "IncSearch", black, orchid, "reverse" ], 159 | [ "Search", cantaloupe, black, "NONE" ], 160 | 161 | [ "Directory", "NONE", teal, "NONE" ], 162 | [ "MatchParen", darkgray, cantaloupe, "NONE" ], 163 | 164 | [ "SpellBad", rose, black, "NONE", rose ], 165 | [ "SpellCap", teal, black, "NONE", teal ], 166 | [ "SpellLocal", asparagus, black, "NONE", asparagus ], 167 | [ "SpellRare", orchid, black, "NONE", orchid ], 168 | 169 | [ "ColorColumn", orchid, "NONE", "NONE" ], 170 | [ "signColumn", "NONE", cantaloupe, "NONE" ], 171 | 172 | [ "ErrorMsg", rose, white, "NONE" ], 173 | [ "ModeMsg", asparagus, black, "NONE" ], 174 | [ "MoreMsg", "NONE", asparagus, "NONE" ], 175 | [ "Question", "NONE", teal, "NONE" ], 176 | [ "WarningMsg", strawberry, black, "NONE" ], 177 | 178 | [ "QuickFixLine", white, darkgray, "NONE" ] 179 | ] 180 | 181 | # Define the color palette used by :terminal when in GUI Vim 182 | # or in TUI Vim when 'termguicolors' is enabled. If this list 183 | # is empty or if it doesn't contain exactly 16 items, the corresponding 184 | # Vim variable won't be set. 185 | # 186 | # The expected values are colors defined in step 2. 187 | terminal_ansi_colors = [ 188 | black, 189 | orchid, 190 | moss, 191 | asparagus, 192 | eggplant, 193 | rose, 194 | sky, 195 | lightergray, 196 | gray, 197 | strawberry, 198 | teal, 199 | cantaloupe, 200 | sky, 201 | strawberry, 202 | sky, 203 | white 204 | ] 205 | 206 | # Step 4: generation 207 | # 208 | # From a separate shell: 209 | # 210 | # $ erb -T - bar.erb > bar.vim 211 | # 212 | # From Vim: 213 | # 214 | # :!erb -T - % > %<.vim 215 | 216 | # These online resources can help you design your colorscheme: 217 | # 218 | # * http://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg 219 | # the xterm palette 220 | # * http://whatcolor.herokuapp.com/ 221 | # play with hexadecimal colors right in the address bar (currently down) 222 | # * http://color.hailpixel.com/ 223 | # similar concept, fuzzier implementation 224 | # * http://colourco.de/ 225 | # similar concept, fancier implementation 226 | # * http://www.colr.org/ 227 | # extract a palette from an image 228 | # * http://colores.manugarri.com/ 229 | # search for 'word', get images and color palettes 230 | # * http://www.colourlovers.com/palettes 231 | # user-created palettes 232 | # * http://www.perbang.dk/color+scheme/ 233 | # a no-nonsense colorscheme generator 234 | # * https://color.adobe.com/ 235 | # Adobe's fancy colorscheme generator 236 | # * http://paletton.com/ 237 | # The classic 'Color Scheme Designer', rebranded 238 | # * http://vrl.cs.brown.edu/color 239 | # A very smart palette generator 240 | # * https://cmcenroe.me/2018/04/03/colour-scheme.html 241 | # "I Made My Own Colour Scheme and You Can Too!" 242 | 243 | # A few general advices: 244 | # 245 | # * The Windows console is limited to the 16 so-called "ANSI" colors but it has 246 | # a few of them interverted which makes numbers impractical. Use color names 247 | # instead of numbers: :help cterm-colors 248 | # * The Windows console (yeah…) doesn't do italics, underlines or bolded text; 249 | # it is limited to normal and reverse. Keep that in mind if you want 250 | # your colorscheme to be usable in as many environments as possible by as many 251 | # people as possible. 252 | # * All of the terminal emulators in use these days allow their users to 253 | # change the 16 so-called "ANSI" colors. It is also possible on some platforms 254 | # to change some or all of the 256 colors in the xterm palette. Don't take 255 | # anything for granted. 256 | # * When used against a light background, strong colors work better than muted 257 | # ones. Light or dark doesn't really matters. Also, it is harder to discriminate 258 | # between two similar colors on a light background. 259 | # * Both strong and muted colors work well against a dark background. It is also 260 | # easier to work with similar colors, but dark colors don't work at all. 261 | # * Use as many text samples as possible. String-heavy languages may look completely 262 | # different than keyword-heavy ones. This can have an impact on the usability 263 | # of your colorscheme. 264 | # * Most terminal emulators and terminal multiplexers currently in use on unix-like 265 | # systems support 256 colors but they almost always default to a '$TERM' that tells 266 | # Vim otherwise. Your users will need to make sure their terminal emulator/multiplexer 267 | # is correctly set up if they want to enjoy the best possible experience. 268 | 269 | # Many thanks to Barry Arthur (https://github.com/dahu) for the original idea. 270 | 271 | # You don't need to edit anything beyond this line. 272 | -%> 273 | " <%= information[:name] %>.vim -- Vim color scheme. 274 | " Author: <%= information[:author] %> (<%= information[:email] %>) 275 | " Webpage: <%= information[:webpage] %> 276 | " Description: <%= information[:description] %> 277 | 278 | hi clear 279 | 280 | if exists("syntax_on") 281 | syntax reset 282 | endif 283 | 284 | let colors_name = "<%= information[:name].downcase %>" 285 | 286 | if ($TERM =~ '256' || &t_Co >= 256) || has("gui_running") 287 | <% for highlight in highlights -%> 288 | <% if highlight.length == 4 -%> 289 | hi <%= highlight[0] %> ctermbg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][1] %> ctermfg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][1] %> cterm=<%= highlight[3] %> guibg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][0] %> guifg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][0] %> gui=<%= highlight[3] %> 290 | <% elsif highlight.length > 4 -%> 291 | hi <%= highlight[0] %> ctermbg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][1] %> ctermfg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][1] %> cterm=<%= highlight[3] %> guibg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][0] %> guifg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][0] %> gui=<%= highlight[3] %> guisp=<%= highlight[4].kind_of?(String) ? highlight[4] : highlight[4][0] %> 292 | <% end -%> 293 | <% end -%> 294 | 295 | elseif &t_Co == 8 || $TERM !~# '^linux' || &t_Co == 16 296 | set t_Co=16 297 | <%= '' %> 298 | <% for highlight in highlights -%> 299 | <% if highlight.length > 2 -%> 300 | hi <%= highlight[0] %> ctermbg=<%= highlight[1].kind_of?(String) ? highlight[1] : highlight[1][2] %> ctermfg=<%= highlight[2].kind_of?(String) ? highlight[2] : highlight[2][2] %> cterm=<%= highlight[3] %> 301 | <% end -%> 302 | <% end -%> 303 | endif 304 | <% links = highlights.select do |highlight| -%> 305 | <% highlight.length == 2 -%> 306 | <% end -%> 307 | <% if links.length > 0 -%> 308 | <%= '' %> 309 | <% for link in links -%> 310 | hi link <%= link[0] %> <%= link[1] %> 311 | <% end -%> 312 | <% end -%> 313 | <% if terminal_ansi_colors.length == 16 -%> 314 | <%= '' %> 315 | let g:terminal_ansi_colors = [ 316 | <% for color in terminal_ansi_colors -%> 317 | \ '<%= color[0] %>', 318 | <% end -%> 319 | \ ] 320 | <% end -%> 321 | 322 | " Generated with RNB (https://gist.github.com/romainl/5cd2f4ec222805f49eca) 323 | --------------------------------------------------------------------------------